Skip to content

Commit d4ae83f

Browse files
committed
[spatialite provider] take into account possible quotation marks for primary key column
1 parent 73674e8 commit d4ae83f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/providers/spatialite/qgsspatialiteprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ void QgsSpatiaLiteProvider::fetchConstraints()
878878
if ( rows >= 1 )
879879
{
880880
QString tableSql = QString::fromUtf8( results[ 1 ] );
881-
QRegularExpression rx( QStringLiteral( "[(,]\\s*%1\\s+INTEGER PRIMARY KEY AUTOINCREMENT" ).arg( mPrimaryKey ), QRegularExpression::CaseInsensitiveOption );
881+
QRegularExpression rx( QStringLiteral( "[(,]\\s*(?:%1|\"%1\")\\s+INTEGER PRIMARY KEY AUTOINCREMENT" ).arg( mPrimaryKey ), QRegularExpression::CaseInsensitiveOption );
882882
if ( tableSql.contains( rx ) )
883883
{
884884
mPrimaryKeyAutoIncrement = true;

0 commit comments

Comments
 (0)