@@ -5330,7 +5330,7 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
5330
5330
" ) VALUES ("
5331
5331
" %1,%2,%3,%4,%5,%6,%7,%8,%9,%10%12"
5332
5332
" )" )
5333
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri. database () ) )
5333
+ .arg ( QgsSpatiaLiteProvider::quotedValue ( QString () ) )
5334
5334
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5335
5335
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5336
5336
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) )
@@ -5345,12 +5345,10 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
5345
5345
5346
5346
QString checkQuery = QString ( " SELECT styleName"
5347
5347
" FROM layer_styles"
5348
- " WHERE f_table_catalog=%1"
5349
- " AND f_table_schema=%2"
5350
- " AND f_table_name=%3"
5351
- " AND f_geometry_column=%4"
5352
- " AND styleName=%5" )
5353
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5348
+ " WHERE f_table_schema=%1"
5349
+ " AND f_table_name=%2"
5350
+ " AND f_geometry_column=%3"
5351
+ " AND styleName=%4" )
5354
5352
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5355
5353
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5356
5354
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) )
@@ -5384,17 +5382,15 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
5384
5382
" ,styleSLD=%3"
5385
5383
" ,description=%4"
5386
5384
" ,owner=%5"
5387
- " WHERE f_table_catalog=%6"
5388
- " AND f_table_schema=%7"
5389
- " AND f_table_name=%8"
5390
- " AND f_geometry_column=%9"
5391
- " AND styleName=%10" )
5385
+ " WHERE f_table_schema=%6"
5386
+ " AND f_table_name=%7"
5387
+ " AND f_geometry_column=%8"
5388
+ " AND styleName=%9" )
5392
5389
.arg ( useAsDefault ? " 1" : " 0" )
5393
5390
.arg ( QgsSpatiaLiteProvider::quotedValue ( qmlStyle ) )
5394
5391
.arg ( QgsSpatiaLiteProvider::quotedValue ( sldStyle ) )
5395
5392
.arg ( QgsSpatiaLiteProvider::quotedValue ( styleDescription.isEmpty () ? QDateTime::currentDateTime ().toString () : styleDescription ) )
5396
5393
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.username () ) )
5397
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5398
5394
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5399
5395
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5400
5396
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) )
@@ -5405,11 +5401,9 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
5405
5401
{
5406
5402
QString removeDefaultSql = QString ( " UPDATE layer_styles"
5407
5403
" SET useAsDefault=0"
5408
- " WHERE f_table_catalog=%1"
5409
- " AND f_table_schema=%2"
5410
- " AND f_table_name=%3"
5411
- " AND f_geometry_column=%4" )
5412
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5404
+ " WHERE f_table_schema=%1"
5405
+ " AND f_table_name=%2"
5406
+ " AND f_geometry_column=%3" )
5413
5407
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5414
5408
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5415
5409
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) );
@@ -5460,13 +5454,11 @@ QGISEXTERN QString loadStyle( const QString& uri, QString& errCause )
5460
5454
5461
5455
QString selectQmlQuery = QString ( " SELECT styleQML"
5462
5456
" FROM layer_styles"
5463
- " WHERE f_table_catalog=%1"
5464
- " AND f_table_schema=%2"
5465
- " AND f_table_name=%3"
5466
- " AND f_geometry_column=%4"
5457
+ " WHERE f_table_schema=%1"
5458
+ " AND f_table_name=%2"
5459
+ " AND f_geometry_column=%3"
5467
5460
" ORDER BY CASE WHEN useAsDefault THEN 1 ELSE 2 END"
5468
5461
" ,update_time DESC LIMIT 1" )
5469
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5470
5462
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5471
5463
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5472
5464
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) );
@@ -5543,11 +5535,9 @@ QGISEXTERN int listStyles( const QString &uri, QStringList &ids, QStringList &na
5543
5535
// get them
5544
5536
QString selectRelatedQuery = QString ( " SELECT id,styleName,description"
5545
5537
" FROM layer_styles"
5546
- " WHERE f_table_catalog=%1"
5547
- " AND f_table_schema=%2"
5548
- " AND f_table_name=%3"
5549
- " AND f_geometry_column=%4" )
5550
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5538
+ " WHERE f_table_schema=%1"
5539
+ " AND f_table_name=%2"
5540
+ " AND f_geometry_column=%3" )
5551
5541
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5552
5542
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5553
5543
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) );
@@ -5572,9 +5562,8 @@ QGISEXTERN int listStyles( const QString &uri, QStringList &ids, QStringList &na
5572
5562
5573
5563
QString selectOthersQuery = QString ( " SELECT id,styleName,description"
5574
5564
" FROM layer_styles"
5575
- " WHERE NOT (f_table_catalog =%1 AND f_table_schema =%2 AND f_table_name=%3 AND f_geometry_column=%4 )"
5565
+ " WHERE NOT (f_table_schema =%1 AND f_table_name =%2 AND f_geometry_column=%3 )"
5576
5566
" ORDER BY update_time DESC" )
5577
- .arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.database () ) )
5578
5567
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.schema () ) )
5579
5568
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.table () ) )
5580
5569
.arg ( QgsSpatiaLiteProvider::quotedValue ( dsUri.geometryColumn () ) );
0 commit comments