Skip to content
Permalink
Browse files

[spatialite provider] take into account possible quotation marks for …

…primary key column
  • Loading branch information
nirvn committed Dec 13, 2017
1 parent 73674e8 commit d4ae83f88cf66d9aa9fcbe60e98f63514a059716
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -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;

0 comments on commit d4ae83f

Please sign in to comment.
You can’t perform that action at this time.