Skip to content

Commit 5988a9c

Browse files
committedAug 2, 2012
fix #6142
1 parent 0926c35 commit 5988a9c

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
6868
mRequestedGeomType = mUri.wkbType();
6969
mIsGeography = false;
7070

71-
if ( mSchemaName.isEmpty() &&
72-
mTableName.startsWith( "(SELECT", Qt::CaseInsensitive ) &&
73-
mTableName.endsWith( ")" ) )
71+
if ( mSchemaName.isEmpty() && mTableName.startsWith( "(" ) && mTableName.endsWith( ")" ) )
7472
{
7573
mIsQuery = true;
7674
mQuery = mTableName;
@@ -1308,8 +1306,7 @@ bool QgsPostgresProvider::hasSufficientPermsAndCapabilities()
13081306
else
13091307
{
13101308
// Check if the sql is a select query
1311-
if ( !mQuery.startsWith( "(SELECT", Qt::CaseInsensitive ) &&
1312-
!mQuery.endsWith( ")" ) )
1309+
if ( !mQuery.startsWith( "(" ) && !mQuery.endsWith( ")" ) )
13131310
{
13141311
QgsMessageLog::logMessage( tr( "The custom query is not a select query." ), tr( "PostGIS" ) );
13151312
return false;

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4280,8 +4280,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
42804280
}
42814281
sqlite3_free_table( results );
42824282
}
4283-
else if ( mQuery.startsWith( "(select", Qt::CaseInsensitive ) &&
4284-
mQuery.endsWith( ")" ) )
4283+
else if ( mQuery.startsWith( "(" ) && mQuery.endsWith( ")" ) )
42854284
{
42864285
// checking if this one is a select query
42874286

0 commit comments

Comments
 (0)
Please sign in to comment.