Skip to content
Permalink
Browse files

fix #6142

  • Loading branch information
jef-n committed Aug 2, 2012
1 parent 0926c35 commit 5988a9c9dc5898ea2fe7463e65e854189e07b16f
@@ -68,9 +68,7 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
mRequestedGeomType = mUri.wkbType();
mIsGeography = false;

if ( mSchemaName.isEmpty() &&
mTableName.startsWith( "(SELECT", Qt::CaseInsensitive ) &&
mTableName.endsWith( ")" ) )
if ( mSchemaName.isEmpty() && mTableName.startsWith( "(" ) && mTableName.endsWith( ")" ) )
{
mIsQuery = true;
mQuery = mTableName;
@@ -1308,8 +1306,7 @@ bool QgsPostgresProvider::hasSufficientPermsAndCapabilities()
else
{
// Check if the sql is a select query
if ( !mQuery.startsWith( "(SELECT", Qt::CaseInsensitive ) &&
!mQuery.endsWith( ")" ) )
if ( !mQuery.startsWith( "(" ) && !mQuery.endsWith( ")" ) )
{
QgsMessageLog::logMessage( tr( "The custom query is not a select query." ), tr( "PostGIS" ) );
return false;
@@ -4280,8 +4280,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
}
sqlite3_free_table( results );
}
else if ( mQuery.startsWith( "(select", Qt::CaseInsensitive ) &&
mQuery.endsWith( ")" ) )
else if ( mQuery.startsWith( "(" ) && mQuery.endsWith( ")" ) )
{
// checking if this one is a select query

0 comments on commit 5988a9c

Please sign in to comment.
You can’t perform that action at this time.