Skip to content
Permalink
Browse files

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

…bles (fixes #15853)

(cherry picked from commit a62fdb0)
  • Loading branch information
jef-n committed Nov 16, 2016
1 parent c72464b commit 27de86c47fa0333784606f00e6025d4ca02e1cf0
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/providers/oracle/qgsoracleprovider.cpp
@@ -581,13 +581,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() );
}
}
@@ -2004,7 +2005,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 27de86c

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