Skip to content
Permalink
Browse files

oracle provider: fix retrieval of column comments for geometryless ta…

…bles (fixes #15853)
  • Loading branch information
jef-n committed Nov 16, 2016
1 parent 04e02af commit a62fdb085d741da898f2bbb048c33b58aee9d630
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/providers/oracle/qgsoracleprovider.cpp
@@ -584,13 +584,14 @@ bool QgsOracleProvider::loadFields()

qry.finish();

if ( exec( qry, QString( "SELECT column_name,comments FROM all_col_comments t WHERE t.owner=%1 AND t.table_name=%2 AND t.column_name<>%3" )
if ( exec( qry, QString( "SELECT column_name,comments FROM all_col_comments t WHERE t.owner=%1 AND t.table_name=%2" )
.arg( quotedValue( mOwnerName ) )
.arg( quotedValue( mTableName ) )
.arg( quotedValue( mGeometryColumn ) ) ) )
.arg( quotedValue( mTableName ) ) ) )
{
while ( qry.next() )
{
if( qry.value( 0 ).toString() == mGeometryColumn )
continue;
comments.insert( qry.value( 0 ).toString(), qry.value( 1 ).toString() );
}
}
@@ -2113,7 +2114,7 @@ bool QgsOracleProvider::setSubsetString( const QString& theSQL, bool updateFeatu
}
qry.finish();

if ( mPrimaryKeyType == pktInt && !uniqueData( mQuery, mAttributeFields[ mPrimaryKeyAttrs[0] ].name() ) )
if ( mPrimaryKeyType == pktInt && !mUseEstimatedMetadata && !uniqueData( mQuery, mAttributeFields[ mPrimaryKeyAttrs[0] ].name() ) )
{
mSqlWhereClause = prevWhere;
return false;

0 comments on commit a62fdb0

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