Skip to content

Commit

Permalink
[spatialite provider] take into account possible quotation marks for …
Browse files Browse the repository at this point in the history
…primary key column
  • Loading branch information
nirvn committed Dec 13, 2017
1 parent 73674e8 commit d4ae83f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -878,7 +878,7 @@ void QgsSpatiaLiteProvider::fetchConstraints()
if ( rows >= 1 )
{
QString tableSql = QString::fromUtf8( results[ 1 ] );
QRegularExpression rx( QStringLiteral( "[(,]\\s*%1\\s+INTEGER PRIMARY KEY AUTOINCREMENT" ).arg( mPrimaryKey ), QRegularExpression::CaseInsensitiveOption );
QRegularExpression rx( QStringLiteral( "[(,]\\s*(?:%1|\"%1\")\\s+INTEGER PRIMARY KEY AUTOINCREMENT" ).arg( mPrimaryKey ), QRegularExpression::CaseInsensitiveOption );
if ( tableSql.contains( rx ) )
{
mPrimaryKeyAutoIncrement = true;
Expand Down

0 comments on commit d4ae83f

Please sign in to comment.