@@ -222,7 +222,7 @@ QgsSpatiaLiteProvider::createEmptyLayer( const QString &uri,
222
222
{
223
223
// delete the table if exists and the related entry in geometry_columns, then re-create it
224
224
sql = QStringLiteral ( " DROP TABLE IF EXISTS %1" )
225
- .arg ( quotedIdentifier ( tableName ) );
225
+ .arg ( QgsSqliteUtils:: quotedIdentifier ( tableName ) );
226
226
227
227
ret = sqlite3_exec ( sqliteHandle, sql.toUtf8 ().constData (), nullptr , nullptr , &errMsg );
228
228
if ( ret != SQLITE_OK )
@@ -237,8 +237,8 @@ QgsSpatiaLiteProvider::createEmptyLayer( const QString &uri,
237
237
}
238
238
239
239
sql = QStringLiteral ( " CREATE TABLE %1 (%2 %3 PRIMARY KEY%4)" )
240
- .arg ( quotedIdentifier ( tableName ),
241
- quotedIdentifier ( primaryKey ),
240
+ .arg ( QgsSqliteUtils:: quotedIdentifier ( tableName ),
241
+ QgsSqliteUtils:: quotedIdentifier ( primaryKey ),
242
242
primaryKeyType,
243
243
primaryKeyType == QLatin1String ( " INTEGER" ) ? QStringLiteral ( " AUTOINCREMENT" ) : QString () );
244
244
@@ -709,7 +709,7 @@ void QgsSpatiaLiteProvider::loadFieldsAbstractInterface( gaiaVectorLayerPtr lyr
709
709
fld = fld->Next ;
710
710
}
711
711
712
- QString sql = QStringLiteral ( " PRAGMA table_info(%1)" ).arg ( quotedIdentifier ( mTableName ) );
712
+ QString sql = QStringLiteral ( " PRAGMA table_info(%1)" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
713
713
714
714
char **results = nullptr ;
715
715
int rows;
@@ -830,7 +830,7 @@ void QgsSpatiaLiteProvider::fetchConstraints()
830
830
831
831
// this is not particularly robust but unfortunately sqlite offers no way to check directly
832
832
// for the presence of constraints on a field (only indexes, but not all constraints are indexes)
833
- QString sql = QStringLiteral ( " SELECT sql FROM sqlite_master WHERE type='table' AND name=%1" ).arg ( quotedIdentifier ( mTableName ) );
833
+ QString sql = QStringLiteral ( " SELECT sql FROM sqlite_master WHERE type='table' AND name=%1" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
834
834
int columns = 0 ;
835
835
int rows = 0 ;
836
836
@@ -882,7 +882,7 @@ void QgsSpatiaLiteProvider::fetchConstraints()
882
882
883
883
if ( mAttributeFields [ fieldIdx ].name () == mPrimaryKey )
884
884
{
885
- QString sql = QStringLiteral ( " SELECT sql FROM sqlite_master WHERE type = 'table' AND tbl_name like %1" ).arg ( quotedIdentifier ( mTableName ) );
885
+ QString sql = QStringLiteral ( " SELECT sql FROM sqlite_master WHERE type = 'table' AND tbl_name like %1" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
886
886
int ret = sqlite3_get_table ( mSqliteHandle , sql.toUtf8 ().constData (), &results, &rows, &columns, &errMsg );
887
887
if ( ret != SQLITE_OK )
888
888
{
@@ -977,7 +977,7 @@ void QgsSpatiaLiteProvider::loadFields()
977
977
mPrimaryKey .clear ();
978
978
mPrimaryKeyAttrs .clear ();
979
979
980
- sql = QStringLiteral ( " PRAGMA table_info(%1)" ).arg ( quotedIdentifier ( mTableName ) );
980
+ sql = QStringLiteral ( " PRAGMA table_info(%1)" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
981
981
982
982
ret = sqlite3_get_table ( mSqliteHandle , sql.toUtf8 ().constData (), &results, &rows, &columns, &errMsg );
983
983
if ( ret != SQLITE_OK )
@@ -1126,7 +1126,7 @@ void QgsSpatiaLiteProvider::determineViewPrimaryKey()
1126
1126
QList<QString> QgsSpatiaLiteProvider::tablePrimaryKeys ( const QString tableName ) const
1127
1127
{
1128
1128
QList<QString> result;
1129
- const QString sql = QStringLiteral ( " PRAGMA table_info(%1)" ).arg ( QgsSpatiaLiteProvider ::quotedIdentifier ( tableName ) );
1129
+ const QString sql = QStringLiteral ( " PRAGMA table_info(%1)" ).arg ( QgsSqliteUtils ::quotedIdentifier ( tableName ) );
1130
1130
char **results = nullptr ;
1131
1131
int rows;
1132
1132
int columns;
@@ -1162,7 +1162,7 @@ bool QgsSpatiaLiteProvider::hasTriggers()
1162
1162
QString sql;
1163
1163
1164
1164
sql = QStringLiteral ( " SELECT * FROM sqlite_master WHERE type='trigger' AND tbl_name=%1" )
1165
- .arg ( quotedIdentifier ( mTableName ) );
1165
+ .arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
1166
1166
1167
1167
ret = sqlite3_get_table ( mSqliteHandle , sql.toUtf8 ().constData (), &results, &rows, &columns, &errMsg );
1168
1168
sqlite3_free_table ( results );
@@ -1175,7 +1175,7 @@ bool QgsSpatiaLiteProvider::hasRowid()
1175
1175
return false ;
1176
1176
1177
1177
// table without rowid column
1178
- QString sql = QStringLiteral ( " SELECT rowid FROM %1 WHERE 0" ).arg ( quotedIdentifier ( mTableName ) );
1178
+ QString sql = QStringLiteral ( " SELECT rowid FROM %1 WHERE 0" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
1179
1179
char *errMsg = nullptr ;
1180
1180
return sqlite3_exec ( mSqliteHandle , sql.toUtf8 (), nullptr , nullptr , &errMsg ) == SQLITE_OK;
1181
1181
}
@@ -3615,7 +3615,7 @@ QVariant QgsSpatiaLiteProvider::minimumValue( int index ) const
3615
3615
// get the field name
3616
3616
QgsField fld = field ( index );
3617
3617
3618
- sql = QStringLiteral ( " SELECT Min(%1) FROM %2" ).arg ( quotedIdentifier ( fld.name () ), mQuery );
3618
+ sql = QStringLiteral ( " SELECT Min(%1) FROM %2" ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ), mQuery );
3619
3619
3620
3620
if ( !mSubsetString .isEmpty () )
3621
3621
{
@@ -3678,7 +3678,7 @@ QVariant QgsSpatiaLiteProvider::maximumValue( int index ) const
3678
3678
// get the field name
3679
3679
QgsField fld = field ( index );
3680
3680
3681
- sql = QStringLiteral ( " SELECT Max(%1) FROM %2" ).arg ( quotedIdentifier ( fld.name () ), mQuery );
3681
+ sql = QStringLiteral ( " SELECT Max(%1) FROM %2" ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ), mQuery );
3682
3682
3683
3683
if ( !mSubsetString .isEmpty () )
3684
3684
{
@@ -3740,14 +3740,14 @@ QSet<QVariant> QgsSpatiaLiteProvider::uniqueValues( int index, int limit ) const
3740
3740
}
3741
3741
QgsField fld = mAttributeFields .at ( index );
3742
3742
3743
- sql = QStringLiteral ( " SELECT DISTINCT %1 FROM %2" ).arg ( quotedIdentifier ( fld.name () ), mQuery );
3743
+ sql = QStringLiteral ( " SELECT DISTINCT %1 FROM %2" ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ), mQuery );
3744
3744
3745
3745
if ( !mSubsetString .isEmpty () )
3746
3746
{
3747
3747
sql += " WHERE ( " + mSubsetString + ' )' ;
3748
3748
}
3749
3749
3750
- sql += QStringLiteral ( " ORDER BY %1" ).arg ( quotedIdentifier ( fld.name () ) );
3750
+ sql += QStringLiteral ( " ORDER BY %1" ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ) );
3751
3751
3752
3752
if ( limit >= 0 )
3753
3753
{
@@ -3819,15 +3819,15 @@ QStringList QgsSpatiaLiteProvider::uniqueStringsMatching( int index, const QStri
3819
3819
}
3820
3820
QgsField fld = mAttributeFields .at ( index );
3821
3821
3822
- sql = QStringLiteral ( " SELECT DISTINCT %1 FROM %2 " ).arg ( quotedIdentifier ( fld.name () ), mQuery );
3823
- sql += QStringLiteral ( " WHERE " ) + quotedIdentifier ( fld.name () ) + QStringLiteral ( " LIKE '%" ) + substring + QStringLiteral ( " %'" );
3822
+ sql = QStringLiteral ( " SELECT DISTINCT %1 FROM %2 " ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ), mQuery );
3823
+ sql += QStringLiteral ( " WHERE " ) + QgsSqliteUtils:: quotedIdentifier ( fld.name () ) + QStringLiteral ( " LIKE '%" ) + substring + QStringLiteral ( " %'" );
3824
3824
3825
3825
if ( !mSubsetString .isEmpty () )
3826
3826
{
3827
3827
sql += QStringLiteral ( " AND ( " ) + mSubsetString + ' )' ;
3828
3828
}
3829
3829
3830
- sql += QStringLiteral ( " ORDER BY %1" ).arg ( quotedIdentifier ( fld.name () ) );
3830
+ sql += QStringLiteral ( " ORDER BY %1" ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ) );
3831
3831
3832
3832
if ( limit >= 0 )
3833
3833
{
@@ -3927,13 +3927,13 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList &flist, Flags flags )
3927
3927
{
3928
3928
toCommit = true ;
3929
3929
3930
- sql = QStringLiteral ( " INSERT INTO %1(" ).arg ( quotedIdentifier ( mTableName ) );
3930
+ sql = QStringLiteral ( " INSERT INTO %1(" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
3931
3931
values = QStringLiteral ( " ) VALUES (" );
3932
3932
separator.clear ();
3933
3933
3934
3934
if ( !mGeometryColumn .isEmpty () )
3935
3935
{
3936
- sql += separator + quotedIdentifier ( mGeometryColumn );
3936
+ sql += separator + QgsSqliteUtils:: quotedIdentifier ( mGeometryColumn );
3937
3937
values += separator + geomParam ();
3938
3938
separator = ' ,' ;
3939
3939
}
@@ -3947,7 +3947,7 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList &flist, Flags flags )
3947
3947
if ( fieldname.isEmpty () || fieldname == mGeometryColumn )
3948
3948
continue ;
3949
3949
3950
- sql += separator + quotedIdentifier ( fieldname );
3950
+ sql += separator + QgsSqliteUtils:: quotedIdentifier ( fieldname );
3951
3951
values += separator + ' ?' ;
3952
3952
separator = ' ,' ;
3953
3953
}
@@ -4135,7 +4135,7 @@ bool QgsSpatiaLiteProvider::createAttributeIndex( int field )
4135
4135
sql = QStringLiteral ( " CREATE INDEX IF NOT EXISTS %1 ON \" %2\" (%3)" )
4136
4136
.arg ( createIndexName ( mTableName , fieldName ),
4137
4137
mTableName ,
4138
- quotedIdentifier ( fieldName ) );
4138
+ QgsSqliteUtils:: quotedIdentifier ( fieldName ) );
4139
4139
ret = sqlite3_exec ( mSqliteHandle , sql.toUtf8 ().constData (), nullptr , nullptr , &errMsg );
4140
4140
if ( ret != SQLITE_OK )
4141
4141
{
@@ -4166,7 +4166,7 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds &id )
4166
4166
return false ;
4167
4167
}
4168
4168
4169
- sql = QStringLiteral ( " DELETE FROM %1 WHERE %2=?" ).arg ( quotedIdentifier ( mTableName ), quotedIdentifier ( mPrimaryKey ) );
4169
+ sql = QStringLiteral ( " DELETE FROM %1 WHERE %2=?" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ), QgsSqliteUtils:: quotedIdentifier ( mPrimaryKey ) );
4170
4170
4171
4171
// SQLite prepared statement
4172
4172
if ( sqlite3_prepare_v2 ( mSqliteHandle , sql.toUtf8 ().constData (), -1 , &stmt, nullptr ) != SQLITE_OK )
@@ -4226,7 +4226,7 @@ bool QgsSpatiaLiteProvider::truncate()
4226
4226
return false ;
4227
4227
}
4228
4228
4229
- sql = QStringLiteral ( " DELETE FROM %1" ).arg ( quotedIdentifier ( mTableName ) );
4229
+ sql = QStringLiteral ( " DELETE FROM %1" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
4230
4230
ret = sqlite3_exec ( mSqliteHandle , sql.toUtf8 ().constData (), nullptr , nullptr , &errMsg );
4231
4231
if ( ret != SQLITE_OK )
4232
4232
{
@@ -4318,7 +4318,7 @@ bool QgsSpatiaLiteProvider::changeAttributeValues( const QgsChangedAttributesMap
4318
4318
if ( attrs.isEmpty () )
4319
4319
continue ;
4320
4320
4321
- QString sql = QStringLiteral ( " UPDATE %1 SET " ).arg ( quotedIdentifier ( mTableName ) );
4321
+ QString sql = QStringLiteral ( " UPDATE %1 SET " ).arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
4322
4322
bool first = true ;
4323
4323
4324
4324
// cycle through the changed attributes of the feature
@@ -4340,30 +4340,30 @@ bool QgsSpatiaLiteProvider::changeAttributeValues( const QgsChangedAttributesMap
4340
4340
if ( val.isNull () || !val.isValid () )
4341
4341
{
4342
4342
// binding a NULL value
4343
- sql += QStringLiteral ( " %1=NULL" ).arg ( quotedIdentifier ( fld.name () ) );
4343
+ sql += QStringLiteral ( " %1=NULL" ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ) );
4344
4344
}
4345
4345
else if ( type == QVariant::Int || type == QVariant::LongLong || type == QVariant::Double )
4346
4346
{
4347
4347
// binding a NUMERIC value
4348
- sql += QStringLiteral ( " %1=%2" ).arg ( quotedIdentifier ( fld.name () ), val.toString () );
4348
+ sql += QStringLiteral ( " %1=%2" ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ), val.toString () );
4349
4349
}
4350
4350
else if ( type == QVariant::StringList || type == QVariant::List )
4351
4351
{
4352
4352
// binding an array value
4353
- sql += QStringLiteral ( " %1=%2" ).arg ( quotedIdentifier ( fld.name () ), QgsSqliteUtils::quotedString ( QgsJsonUtils::encodeValue ( val ) ) );
4353
+ sql += QStringLiteral ( " %1=%2" ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ), QgsSqliteUtils::quotedString ( QgsJsonUtils::encodeValue ( val ) ) );
4354
4354
}
4355
4355
else
4356
4356
{
4357
4357
// binding a TEXT value
4358
- sql += QStringLiteral ( " %1=%2" ).arg ( quotedIdentifier ( fld.name () ), QgsSqliteUtils::quotedString ( val.toString () ) );
4358
+ sql += QStringLiteral ( " %1=%2" ).arg ( QgsSqliteUtils:: quotedIdentifier ( fld.name () ), QgsSqliteUtils::quotedString ( val.toString () ) );
4359
4359
}
4360
4360
}
4361
4361
catch ( SLFieldNotFound )
4362
4362
{
4363
4363
// Field was missing - shouldn't happen
4364
4364
}
4365
4365
}
4366
- sql += QStringLiteral ( " WHERE %1=%2" ).arg ( quotedIdentifier ( mPrimaryKey ) ).arg ( fid );
4366
+ sql += QStringLiteral ( " WHERE %1=%2" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mPrimaryKey ) ).arg ( fid );
4367
4367
4368
4368
ret = sqlite3_exec ( mSqliteHandle , sql.toUtf8 ().constData (), nullptr , nullptr , &errMsg );
4369
4369
if ( ret != SQLITE_OK )
@@ -4398,10 +4398,10 @@ bool QgsSpatiaLiteProvider::changeGeometryValues( const QgsGeometryMap &geometry
4398
4398
4399
4399
sql =
4400
4400
QStringLiteral ( " UPDATE %1 SET %2=GeomFromWKB(?, %3) WHERE %4=?" )
4401
- .arg ( quotedIdentifier ( mTableName ),
4402
- quotedIdentifier ( mGeometryColumn ) )
4401
+ .arg ( QgsSqliteUtils:: quotedIdentifier ( mTableName ),
4402
+ QgsSqliteUtils:: quotedIdentifier ( mGeometryColumn ) )
4403
4403
.arg ( mSrid )
4404
- .arg ( quotedIdentifier ( mPrimaryKey ) );
4404
+ .arg ( QgsSqliteUtils:: quotedIdentifier ( mPrimaryKey ) );
4405
4405
4406
4406
// SQLite prepared statement
4407
4407
if ( sqlite3_prepare_v2 ( mSqliteHandle , sql.toUtf8 ().constData (), -1 , &stmt, nullptr ) != SQLITE_OK )
@@ -4487,12 +4487,6 @@ void QgsSpatiaLiteProvider::closeDb()
4487
4487
}
4488
4488
}
4489
4489
4490
- QString QgsSpatiaLiteProvider::quotedIdentifier ( QString id )
4491
- {
4492
- id.replace ( ' \" ' , QLatin1String ( " \"\" " ) );
4493
- return id.prepend ( ' \" ' ).append ( ' \" ' );
4494
- }
4495
-
4496
4490
bool QgsSpatiaLiteProvider::checkLayerTypeAbstractInterface ( gaiaVectorLayerPtr lyr )
4497
4491
{
4498
4492
if ( !lyr )
@@ -4529,7 +4523,7 @@ bool QgsSpatiaLiteProvider::checkLayerTypeAbstractInterface( gaiaVectorLayerPtr
4529
4523
4530
4524
if ( !mIsQuery )
4531
4525
{
4532
- mQuery = quotedIdentifier ( mTableName );
4526
+ mQuery = QgsSqliteUtils:: quotedIdentifier ( mTableName );
4533
4527
}
4534
4528
4535
4529
return true ;
@@ -4601,9 +4595,9 @@ bool QgsSpatiaLiteProvider::checkLayerType()
4601
4595
// convert the custom query into a subquery
4602
4596
mQuery = QStringLiteral ( " %1 as %2" )
4603
4597
.arg ( mQuery ,
4604
- quotedIdentifier ( alias ) );
4598
+ QgsSqliteUtils:: quotedIdentifier ( alias ) );
4605
4599
4606
- sql = QStringLiteral ( " SELECT 0, %1 FROM %2 LIMIT 1" ).arg ( quotedIdentifier ( mGeometryColumn ), mQuery );
4600
+ sql = QStringLiteral ( " SELECT 0, %1 FROM %2 LIMIT 1" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mGeometryColumn ), mQuery );
4607
4601
ret = sqlite3_get_table ( mSqliteHandle , sql.toUtf8 ().constData (), &results, &rows, &columns, &errMsg );
4608
4602
4609
4603
// Try to find a PK or try to use ROWID
@@ -4667,7 +4661,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
4667
4661
}
4668
4662
4669
4663
// Try first without any injection or manipulation
4670
- sql = QStringLiteral ( " SELECT %1, %2 FROM %3 LIMIT 1" ).arg ( quotedIdentifier ( pks.first ( ) ), quotedIdentifier ( mGeometryColumn ), mQuery );
4664
+ sql = QStringLiteral ( " SELECT %1, %2 FROM %3 LIMIT 1" ).arg ( QgsSqliteUtils:: quotedIdentifier ( pks.first ( ) ), quotedIdentifier ( mGeometryColumn ), mQuery );
4671
4665
ret = sqlite3_get_table ( mSqliteHandle , sql.toUtf8 ().constData (), &results, &rows, &columns, &errMsg );
4672
4666
if ( ret == SQLITE_OK && rows == 1 )
4673
4667
{
@@ -4696,7 +4690,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
4696
4690
// 4. check if the table has a usable ROWID
4697
4691
if ( ! queryGeomTableName.isEmpty () )
4698
4692
{
4699
- sql = QStringLiteral ( " SELECT ROWID FROM %1 WHERE ROWID IS NOT NULL LIMIT 1" ).arg ( quotedIdentifier ( queryGeomTableName ) );
4693
+ sql = QStringLiteral ( " SELECT ROWID FROM %1 WHERE ROWID IS NOT NULL LIMIT 1" ).arg ( QgsSqliteUtils:: quotedIdentifier ( queryGeomTableName ) );
4700
4694
ret = sqlite3_get_table ( mSqliteHandle , sql.toUtf8 ().constData (), &results, &rows, &columns, &errMsg );
4701
4695
if ( ret != SQLITE_OK || rows != 1 )
4702
4696
{
@@ -4708,7 +4702,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
4708
4702
{
4709
4703
const QString newSql ( mQuery .replace ( injectionRe,
4710
4704
QStringLiteral ( R"re( SELECT %1.%2, \1)re" )
4711
- .arg ( quotedIdentifier ( tableIdentifier ),
4705
+ .arg ( QgsSqliteUtils:: quotedIdentifier ( tableIdentifier ),
4712
4706
QStringLiteral ( " ROWID" ) ) ) );
4713
4707
sql = QStringLiteral ( " SELECT ROWID FROM %1 WHERE ROWID IS NOT NULL LIMIT 1" ).arg ( newSql );
4714
4708
ret = sqlite3_get_table ( mSqliteHandle , sql.toUtf8 ().constData (), &results, &rows, &columns, &errMsg );
@@ -4827,7 +4821,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
4827
4821
4828
4822
if ( !mIsQuery )
4829
4823
{
4830
- mQuery = quotedIdentifier ( mTableName );
4824
+ mQuery = QgsSqliteUtils:: quotedIdentifier ( mTableName );
4831
4825
}
4832
4826
4833
4827
// checking for validity
@@ -5219,7 +5213,7 @@ bool QgsSpatiaLiteProvider::getQueryGeometryDetails()
5219
5213
// get stuff from the relevant column instead. This may (will?)
5220
5214
// fail if there is no data in the relevant table.
5221
5215
QString sql = QStringLiteral ( " select srid(%1), geometrytype(%1) from %2" )
5222
- .arg ( quotedIdentifier ( mGeometryColumn ),
5216
+ .arg ( QgsSqliteUtils:: quotedIdentifier ( mGeometryColumn ),
5223
5217
mQuery );
5224
5218
5225
5219
// it is possible that the where clause restricts the feature type
@@ -5261,7 +5255,7 @@ bool QgsSpatiaLiteProvider::getQueryGeometryDetails()
5261
5255
" when geometrytype(%1) IN ('POLYGON','MULTIPOLYGON') THEN 'POLYGON'"
5262
5256
" end "
5263
5257
" from %2" )
5264
- .arg ( quotedIdentifier ( mGeometryColumn ),
5258
+ .arg ( QgsSqliteUtils:: quotedIdentifier ( mGeometryColumn ),
5265
5259
mQuery );
5266
5260
5267
5261
if ( !mSubsetString .isEmpty () )
@@ -5384,7 +5378,7 @@ bool QgsSpatiaLiteProvider::getTableSummary()
5384
5378
char *errMsg = nullptr ;
5385
5379
5386
5380
QString sql = QStringLiteral ( " SELECT Count(*)%1 FROM %2" )
5387
- .arg ( mGeometryColumn .isEmpty () ? QString () : QStringLiteral ( " ,Min(MbrMinX(%1)),Min(MbrMinY(%1)),Max(MbrMaxX(%1)),Max(MbrMaxY(%1))" ).arg ( quotedIdentifier ( mGeometryColumn ) ),
5381
+ .arg ( mGeometryColumn .isEmpty () ? QString () : QStringLiteral ( " ,Min(MbrMinX(%1)),Min(MbrMinY(%1)),Max(MbrMaxX(%1)),Max(MbrMaxY(%1))" ).arg ( QgsSqliteUtils:: quotedIdentifier ( mGeometryColumn ) ),
5388
5382
mQuery );
5389
5383
5390
5384
if ( !mSubsetString .isEmpty () )
@@ -5651,7 +5645,7 @@ QList<QgsVectorLayer *> QgsSpatiaLiteProvider::searchLayers( const QList<QgsVect
5651
5645
QList<QgsRelation> QgsSpatiaLiteProvider::discoverRelations ( const QgsVectorLayer *self, const QList<QgsVectorLayer *> &layers ) const
5652
5646
{
5653
5647
QList<QgsRelation> output;
5654
- const QString sql = QStringLiteral ( " PRAGMA foreign_key_list(%1)" ).arg ( QgsSpatiaLiteProvider::quotedIdentifier ( mTableName ) );
5648
+ const QString sql = QStringLiteral ( " PRAGMA foreign_key_list(%1)" ).arg ( QgsSpatiaLiteProvider::QgsSqliteUtils:: quotedIdentifier ( mTableName ) );
5655
5649
char **results = nullptr ;
5656
5650
int rows;
5657
5651
int columns;
0 commit comments