Skip to content

Commit d3cdf28

Browse files
committedDec 19, 2018
Use QgsSqliteUtils::quotedIdentifier in spatialite provider
1 parent 237d40a commit d3cdf28

File tree

2 files changed

+43
-50
lines changed

2 files changed

+43
-50
lines changed
 

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 43 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ QgsSpatiaLiteProvider::createEmptyLayer( const QString &uri,
222222
{
223223
// delete the table if exists and the related entry in geometry_columns, then re-create it
224224
sql = QStringLiteral( "DROP TABLE IF EXISTS %1" )
225-
.arg( quotedIdentifier( tableName ) );
225+
.arg( QgsSqliteUtils::quotedIdentifier( tableName ) );
226226

227227
ret = sqlite3_exec( sqliteHandle, sql.toUtf8().constData(), nullptr, nullptr, &errMsg );
228228
if ( ret != SQLITE_OK )
@@ -237,8 +237,8 @@ QgsSpatiaLiteProvider::createEmptyLayer( const QString &uri,
237237
}
238238

239239
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 ),
242242
primaryKeyType,
243243
primaryKeyType == QLatin1String( "INTEGER" ) ? QStringLiteral( " AUTOINCREMENT" ) : QString() );
244244

@@ -709,7 +709,7 @@ void QgsSpatiaLiteProvider::loadFieldsAbstractInterface( gaiaVectorLayerPtr lyr
709709
fld = fld->Next;
710710
}
711711

712-
QString sql = QStringLiteral( "PRAGMA table_info(%1)" ).arg( quotedIdentifier( mTableName ) );
712+
QString sql = QStringLiteral( "PRAGMA table_info(%1)" ).arg( QgsSqliteUtils::quotedIdentifier( mTableName ) );
713713

714714
char **results = nullptr;
715715
int rows;
@@ -830,7 +830,7 @@ void QgsSpatiaLiteProvider::fetchConstraints()
830830

831831
// this is not particularly robust but unfortunately sqlite offers no way to check directly
832832
// 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 ) );
834834
int columns = 0;
835835
int rows = 0;
836836

@@ -882,7 +882,7 @@ void QgsSpatiaLiteProvider::fetchConstraints()
882882

883883
if ( mAttributeFields[ fieldIdx ].name() == mPrimaryKey )
884884
{
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 ) );
886886
int ret = sqlite3_get_table( mSqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg );
887887
if ( ret != SQLITE_OK )
888888
{
@@ -977,7 +977,7 @@ void QgsSpatiaLiteProvider::loadFields()
977977
mPrimaryKey.clear();
978978
mPrimaryKeyAttrs.clear();
979979

980-
sql = QStringLiteral( "PRAGMA table_info(%1)" ).arg( quotedIdentifier( mTableName ) );
980+
sql = QStringLiteral( "PRAGMA table_info(%1)" ).arg( QgsSqliteUtils::quotedIdentifier( mTableName ) );
981981

982982
ret = sqlite3_get_table( mSqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg );
983983
if ( ret != SQLITE_OK )
@@ -1126,7 +1126,7 @@ void QgsSpatiaLiteProvider::determineViewPrimaryKey()
11261126
QList<QString> QgsSpatiaLiteProvider::tablePrimaryKeys( const QString tableName ) const
11271127
{
11281128
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 ) );
11301130
char **results = nullptr;
11311131
int rows;
11321132
int columns;
@@ -1162,7 +1162,7 @@ bool QgsSpatiaLiteProvider::hasTriggers()
11621162
QString sql;
11631163

11641164
sql = QStringLiteral( "SELECT * FROM sqlite_master WHERE type='trigger' AND tbl_name=%1" )
1165-
.arg( quotedIdentifier( mTableName ) );
1165+
.arg( QgsSqliteUtils::quotedIdentifier( mTableName ) );
11661166

11671167
ret = sqlite3_get_table( mSqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg );
11681168
sqlite3_free_table( results );
@@ -1175,7 +1175,7 @@ bool QgsSpatiaLiteProvider::hasRowid()
11751175
return false;
11761176

11771177
// 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 ) );
11791179
char *errMsg = nullptr;
11801180
return sqlite3_exec( mSqliteHandle, sql.toUtf8(), nullptr, nullptr, &errMsg ) == SQLITE_OK;
11811181
}
@@ -3615,7 +3615,7 @@ QVariant QgsSpatiaLiteProvider::minimumValue( int index ) const
36153615
// get the field name
36163616
QgsField fld = field( index );
36173617

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 );
36193619

36203620
if ( !mSubsetString.isEmpty() )
36213621
{
@@ -3678,7 +3678,7 @@ QVariant QgsSpatiaLiteProvider::maximumValue( int index ) const
36783678
// get the field name
36793679
QgsField fld = field( index );
36803680

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 );
36823682

36833683
if ( !mSubsetString.isEmpty() )
36843684
{
@@ -3740,14 +3740,14 @@ QSet<QVariant> QgsSpatiaLiteProvider::uniqueValues( int index, int limit ) const
37403740
}
37413741
QgsField fld = mAttributeFields.at( index );
37423742

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 );
37443744

37453745
if ( !mSubsetString.isEmpty() )
37463746
{
37473747
sql += " WHERE ( " + mSubsetString + ')';
37483748
}
37493749

3750-
sql += QStringLiteral( " ORDER BY %1" ).arg( quotedIdentifier( fld.name() ) );
3750+
sql += QStringLiteral( " ORDER BY %1" ).arg( QgsSqliteUtils::quotedIdentifier( fld.name() ) );
37513751

37523752
if ( limit >= 0 )
37533753
{
@@ -3819,15 +3819,15 @@ QStringList QgsSpatiaLiteProvider::uniqueStringsMatching( int index, const QStri
38193819
}
38203820
QgsField fld = mAttributeFields.at( index );
38213821

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( "%'" );
38243824

38253825
if ( !mSubsetString.isEmpty() )
38263826
{
38273827
sql += QStringLiteral( " AND ( " ) + mSubsetString + ')';
38283828
}
38293829

3830-
sql += QStringLiteral( " ORDER BY %1" ).arg( quotedIdentifier( fld.name() ) );
3830+
sql += QStringLiteral( " ORDER BY %1" ).arg( QgsSqliteUtils::quotedIdentifier( fld.name() ) );
38313831

38323832
if ( limit >= 0 )
38333833
{
@@ -3927,13 +3927,13 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList &flist, Flags flags )
39273927
{
39283928
toCommit = true;
39293929

3930-
sql = QStringLiteral( "INSERT INTO %1(" ).arg( quotedIdentifier( mTableName ) );
3930+
sql = QStringLiteral( "INSERT INTO %1(" ).arg( QgsSqliteUtils::quotedIdentifier( mTableName ) );
39313931
values = QStringLiteral( ") VALUES (" );
39323932
separator.clear();
39333933

39343934
if ( !mGeometryColumn.isEmpty() )
39353935
{
3936-
sql += separator + quotedIdentifier( mGeometryColumn );
3936+
sql += separator + QgsSqliteUtils::quotedIdentifier( mGeometryColumn );
39373937
values += separator + geomParam();
39383938
separator = ',';
39393939
}
@@ -3947,7 +3947,7 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList &flist, Flags flags )
39473947
if ( fieldname.isEmpty() || fieldname == mGeometryColumn )
39483948
continue;
39493949

3950-
sql += separator + quotedIdentifier( fieldname );
3950+
sql += separator + QgsSqliteUtils::quotedIdentifier( fieldname );
39513951
values += separator + '?';
39523952
separator = ',';
39533953
}
@@ -4135,7 +4135,7 @@ bool QgsSpatiaLiteProvider::createAttributeIndex( int field )
41354135
sql = QStringLiteral( "CREATE INDEX IF NOT EXISTS %1 ON \"%2\" (%3)" )
41364136
.arg( createIndexName( mTableName, fieldName ),
41374137
mTableName,
4138-
quotedIdentifier( fieldName ) );
4138+
QgsSqliteUtils::quotedIdentifier( fieldName ) );
41394139
ret = sqlite3_exec( mSqliteHandle, sql.toUtf8().constData(), nullptr, nullptr, &errMsg );
41404140
if ( ret != SQLITE_OK )
41414141
{
@@ -4166,7 +4166,7 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds &id )
41664166
return false;
41674167
}
41684168

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 ) );
41704170

41714171
// SQLite prepared statement
41724172
if ( sqlite3_prepare_v2( mSqliteHandle, sql.toUtf8().constData(), -1, &stmt, nullptr ) != SQLITE_OK )
@@ -4226,7 +4226,7 @@ bool QgsSpatiaLiteProvider::truncate()
42264226
return false;
42274227
}
42284228

4229-
sql = QStringLiteral( "DELETE FROM %1" ).arg( quotedIdentifier( mTableName ) );
4229+
sql = QStringLiteral( "DELETE FROM %1" ).arg( QgsSqliteUtils::quotedIdentifier( mTableName ) );
42304230
ret = sqlite3_exec( mSqliteHandle, sql.toUtf8().constData(), nullptr, nullptr, &errMsg );
42314231
if ( ret != SQLITE_OK )
42324232
{
@@ -4318,7 +4318,7 @@ bool QgsSpatiaLiteProvider::changeAttributeValues( const QgsChangedAttributesMap
43184318
if ( attrs.isEmpty() )
43194319
continue;
43204320

4321-
QString sql = QStringLiteral( "UPDATE %1 SET " ).arg( quotedIdentifier( mTableName ) );
4321+
QString sql = QStringLiteral( "UPDATE %1 SET " ).arg( QgsSqliteUtils::quotedIdentifier( mTableName ) );
43224322
bool first = true;
43234323

43244324
// cycle through the changed attributes of the feature
@@ -4340,30 +4340,30 @@ bool QgsSpatiaLiteProvider::changeAttributeValues( const QgsChangedAttributesMap
43404340
if ( val.isNull() || !val.isValid() )
43414341
{
43424342
// binding a NULL value
4343-
sql += QStringLiteral( "%1=NULL" ).arg( quotedIdentifier( fld.name() ) );
4343+
sql += QStringLiteral( "%1=NULL" ).arg( QgsSqliteUtils::quotedIdentifier( fld.name() ) );
43444344
}
43454345
else if ( type == QVariant::Int || type == QVariant::LongLong || type == QVariant::Double )
43464346
{
43474347
// 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() );
43494349
}
43504350
else if ( type == QVariant::StringList || type == QVariant::List )
43514351
{
43524352
// 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 ) ) );
43544354
}
43554355
else
43564356
{
43574357
// 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() ) );
43594359
}
43604360
}
43614361
catch ( SLFieldNotFound )
43624362
{
43634363
// Field was missing - shouldn't happen
43644364
}
43654365
}
4366-
sql += QStringLiteral( " WHERE %1=%2" ).arg( quotedIdentifier( mPrimaryKey ) ).arg( fid );
4366+
sql += QStringLiteral( " WHERE %1=%2" ).arg( QgsSqliteUtils::quotedIdentifier( mPrimaryKey ) ).arg( fid );
43674367

43684368
ret = sqlite3_exec( mSqliteHandle, sql.toUtf8().constData(), nullptr, nullptr, &errMsg );
43694369
if ( ret != SQLITE_OK )
@@ -4398,10 +4398,10 @@ bool QgsSpatiaLiteProvider::changeGeometryValues( const QgsGeometryMap &geometry
43984398

43994399
sql =
44004400
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 ) )
44034403
.arg( mSrid )
4404-
.arg( quotedIdentifier( mPrimaryKey ) );
4404+
.arg( QgsSqliteUtils::quotedIdentifier( mPrimaryKey ) );
44054405

44064406
// SQLite prepared statement
44074407
if ( sqlite3_prepare_v2( mSqliteHandle, sql.toUtf8().constData(), -1, &stmt, nullptr ) != SQLITE_OK )
@@ -4487,12 +4487,6 @@ void QgsSpatiaLiteProvider::closeDb()
44874487
}
44884488
}
44894489

4490-
QString QgsSpatiaLiteProvider::quotedIdentifier( QString id )
4491-
{
4492-
id.replace( '\"', QLatin1String( "\"\"" ) );
4493-
return id.prepend( '\"' ).append( '\"' );
4494-
}
4495-
44964490
bool QgsSpatiaLiteProvider::checkLayerTypeAbstractInterface( gaiaVectorLayerPtr lyr )
44974491
{
44984492
if ( !lyr )
@@ -4529,7 +4523,7 @@ bool QgsSpatiaLiteProvider::checkLayerTypeAbstractInterface( gaiaVectorLayerPtr
45294523

45304524
if ( !mIsQuery )
45314525
{
4532-
mQuery = quotedIdentifier( mTableName );
4526+
mQuery = QgsSqliteUtils::quotedIdentifier( mTableName );
45334527
}
45344528

45354529
return true;
@@ -4601,9 +4595,9 @@ bool QgsSpatiaLiteProvider::checkLayerType()
46014595
// convert the custom query into a subquery
46024596
mQuery = QStringLiteral( "%1 as %2" )
46034597
.arg( mQuery,
4604-
quotedIdentifier( alias ) );
4598+
QgsSqliteUtils::quotedIdentifier( alias ) );
46054599

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 );
46074601
ret = sqlite3_get_table( mSqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg );
46084602

46094603
// Try to find a PK or try to use ROWID
@@ -4667,7 +4661,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
46674661
}
46684662

46694663
// 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 );
46714665
ret = sqlite3_get_table( mSqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg );
46724666
if ( ret == SQLITE_OK && rows == 1 )
46734667
{
@@ -4696,7 +4690,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
46964690
// 4. check if the table has a usable ROWID
46974691
if ( ! queryGeomTableName.isEmpty() )
46984692
{
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 ) );
47004694
ret = sqlite3_get_table( mSqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg );
47014695
if ( ret != SQLITE_OK || rows != 1 )
47024696
{
@@ -4708,7 +4702,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
47084702
{
47094703
const QString newSql( mQuery.replace( injectionRe,
47104704
QStringLiteral( R"re(SELECT %1.%2, \1)re" )
4711-
.arg( quotedIdentifier( tableIdentifier ),
4705+
.arg( QgsSqliteUtils::quotedIdentifier( tableIdentifier ),
47124706
QStringLiteral( "ROWID" ) ) ) );
47134707
sql = QStringLiteral( "SELECT ROWID FROM %1 WHERE ROWID IS NOT NULL LIMIT 1" ).arg( newSql );
47144708
ret = sqlite3_get_table( mSqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg );
@@ -4827,7 +4821,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
48274821

48284822
if ( !mIsQuery )
48294823
{
4830-
mQuery = quotedIdentifier( mTableName );
4824+
mQuery = QgsSqliteUtils::quotedIdentifier( mTableName );
48314825
}
48324826

48334827
// checking for validity
@@ -5219,7 +5213,7 @@ bool QgsSpatiaLiteProvider::getQueryGeometryDetails()
52195213
// get stuff from the relevant column instead. This may (will?)
52205214
// fail if there is no data in the relevant table.
52215215
QString sql = QStringLiteral( "select srid(%1), geometrytype(%1) from %2" )
5222-
.arg( quotedIdentifier( mGeometryColumn ),
5216+
.arg( QgsSqliteUtils::quotedIdentifier( mGeometryColumn ),
52235217
mQuery );
52245218

52255219
//it is possible that the where clause restricts the feature type
@@ -5261,7 +5255,7 @@ bool QgsSpatiaLiteProvider::getQueryGeometryDetails()
52615255
" when geometrytype(%1) IN ('POLYGON','MULTIPOLYGON') THEN 'POLYGON'"
52625256
" end "
52635257
"from %2" )
5264-
.arg( quotedIdentifier( mGeometryColumn ),
5258+
.arg( QgsSqliteUtils::quotedIdentifier( mGeometryColumn ),
52655259
mQuery );
52665260

52675261
if ( !mSubsetString.isEmpty() )
@@ -5384,7 +5378,7 @@ bool QgsSpatiaLiteProvider::getTableSummary()
53845378
char *errMsg = nullptr;
53855379

53865380
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 ) ),
53885382
mQuery );
53895383

53905384
if ( !mSubsetString.isEmpty() )
@@ -5651,7 +5645,7 @@ QList<QgsVectorLayer *> QgsSpatiaLiteProvider::searchLayers( const QList<QgsVect
56515645
QList<QgsRelation> QgsSpatiaLiteProvider::discoverRelations( const QgsVectorLayer *self, const QList<QgsVectorLayer *> &layers ) const
56525646
{
56535647
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 ) );
56555649
char **results = nullptr;
56565650
int rows;
56575651
int columns;

‎src/providers/spatialite/qgsspatialiteprovider.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
143143
unsigned char **wkb, int *geom_size );
144144
static int computeMultiWKB3Dsize( const unsigned char *p_in, int little_endian,
145145
int endian_arch );
146-
static QString quotedIdentifier( QString id );
147146

148147
struct SLFieldNotFound {}; //! Exception to throw
149148

0 commit comments

Comments
 (0)
Please sign in to comment.