Skip to content

Commit

Permalink
oracle provider: fix retrieval of column comments for geometryless ta…
Browse files Browse the repository at this point in the history
…bles (fixes #15853)

(cherry picked from commit a62fdb0)
  • Loading branch information
jef-n committed Nov 16, 2016
1 parent b32a719 commit f2e3d53
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/providers/oracle/qgsoracleprovider.cpp
Expand Up @@ -582,13 +582,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() );
}
}
Expand Down Expand Up @@ -2153,7 +2154,7 @@ bool QgsOracleProvider::setSubsetString( const QString& theSQL, bool updateFeatu
}
qry.finish();

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

0 comments on commit f2e3d53

Please sign in to comment.