@@ -5333,7 +5333,7 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
5333
5333
" ) VALUES ("
5334
5334
" %1,%2,%3,%4,%5,%6,%7,%8,%9,%10%12"
5335
5335
" )" )
5336
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri. database () ) )
5336
+ .arg ( QgsSpatiaLiteProvider::quotedValue ( QString () ) )
5337
5337
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5338
5338
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5339
5339
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) )
@@ -5348,12 +5348,10 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
5348
5348
5349
5349
QString checkQuery = QString ( " SELECT styleName"
5350
5350
" FROM layer_styles"
5351
- " WHERE f_table_catalog=%1"
5352
- " AND f_table_schema=%2"
5353
- " AND f_table_name=%3"
5354
- " AND f_geometry_column=%4"
5355
- " AND styleName=%5" )
5356
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5351
+ " WHERE f_table_schema=%1"
5352
+ " AND f_table_name=%2"
5353
+ " AND f_geometry_column=%3"
5354
+ " AND styleName=%4" )
5357
5355
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5358
5356
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5359
5357
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) )
@@ -5387,17 +5385,15 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
5387
5385
" ,styleSLD=%3"
5388
5386
" ,description=%4"
5389
5387
" ,owner=%5"
5390
- " WHERE f_table_catalog=%6"
5391
- " AND f_table_schema=%7"
5392
- " AND f_table_name=%8"
5393
- " AND f_geometry_column=%9"
5394
- " AND styleName=%10" )
5388
+ " WHERE f_table_schema=%6"
5389
+ " AND f_table_name=%7"
5390
+ " AND f_geometry_column=%8"
5391
+ " AND styleName=%9" )
5395
5392
.arg ( useAsDefault ? " 1" : " 0" )
5396
5393
.arg ( QgsSpatiaLiteProvider::quotedValue ( qmlStyle ) )
5397
5394
.arg ( QgsSpatiaLiteProvider::quotedValue ( sldStyle ) )
5398
5395
.arg ( QgsSpatiaLiteProvider::quotedValue ( styleDescription.isEmpty () ? QDateTime::currentDateTime ().toString () : styleDescription ) )
5399
5396
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.username () ) )
5400
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5401
5397
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5402
5398
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5403
5399
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) )
@@ -5408,11 +5404,9 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
5408
5404
{
5409
5405
QString removeDefaultSql = QString ( " UPDATE layer_styles"
5410
5406
" SET useAsDefault=0"
5411
- " WHERE f_table_catalog=%1"
5412
- " AND f_table_schema=%2"
5413
- " AND f_table_name=%3"
5414
- " AND f_geometry_column=%4" )
5415
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5407
+ " WHERE f_table_schema=%1"
5408
+ " AND f_table_name=%2"
5409
+ " AND f_geometry_column=%3" )
5416
5410
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5417
5411
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5418
5412
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) );
@@ -5455,13 +5449,11 @@ QGISEXTERN QString loadStyle( const QString& uri, QString& errCause )
5455
5449
5456
5450
QString selectQmlQuery = QString ( " SELECT styleQML"
5457
5451
" FROM layer_styles"
5458
- " WHERE f_table_catalog=%1"
5459
- " AND f_table_schema=%2"
5460
- " AND f_table_name=%3"
5461
- " AND f_geometry_column=%4"
5452
+ " WHERE f_table_schema=%1"
5453
+ " AND f_table_name=%2"
5454
+ " AND f_geometry_column=%3"
5462
5455
" ORDER BY CASE WHEN useAsDefault THEN 1 ELSE 2 END"
5463
5456
" ,update_time DESC LIMIT 1" )
5464
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5465
5457
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5466
5458
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5467
5459
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) );
@@ -5538,11 +5530,9 @@ QGISEXTERN int listStyles( const QString &uri, QStringList &ids, QStringList &na
5538
5530
// get them
5539
5531
QString selectRelatedQuery = QString ( " SELECT id,styleName,description"
5540
5532
" FROM layer_styles"
5541
- " WHERE f_table_catalog=%1"
5542
- " AND f_table_schema=%2"
5543
- " AND f_table_name=%3"
5544
- " AND f_geometry_column=%4" )
5545
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5533
+ " WHERE f_table_schema=%1"
5534
+ " AND f_table_name=%2"
5535
+ " AND f_geometry_column=%3" )
5546
5536
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5547
5537
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5548
5538
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) );
@@ -5567,9 +5557,8 @@ QGISEXTERN int listStyles( const QString &uri, QStringList &ids, QStringList &na
5567
5557
5568
5558
QString selectOthersQuery = QString ( " SELECT id,styleName,description"
5569
5559
" FROM layer_styles"
5570
- " WHERE NOT (f_table_catalog =%1 AND f_table_schema =%2 AND f_table_name=%3 AND f_geometry_column=%4 )"
5560
+ " WHERE NOT (f_table_schema =%1 AND f_table_name =%2 AND f_geometry_column=%3 )"
5571
5561
" ORDER BY update_time DESC" )
5572
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5573
5562
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5574
5563
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5575
5564
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) );
0 commit comments