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