Skip to content

Commit 27de86c

Browse files
committedNov 16, 2016
oracle provider: fix retrieval of column comments for geometryless tables (fixes #15853)
(cherry picked from commit a62fdb0)
1 parent c72464b commit 27de86c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎src/providers/oracle/qgsoracleprovider.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,13 +581,14 @@ bool QgsOracleProvider::loadFields()
581581

582582
qry.finish();
583583

584-
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" )
584+
if ( exec( qry, QString( "SELECT column_name,comments FROM all_col_comments t WHERE t.owner=%1 AND t.table_name=%2" )
585585
.arg( quotedValue( mOwnerName ) )
586-
.arg( quotedValue( mTableName ) )
587-
.arg( quotedValue( mGeometryColumn ) ) ) )
586+
.arg( quotedValue( mTableName ) ) ) )
588587
{
589588
while ( qry.next() )
590589
{
590+
if( qry.value( 0 ).toString() == mGeometryColumn )
591+
continue;
591592
comments.insert( qry.value( 0 ).toString(), qry.value( 1 ).toString() );
592593
}
593594
}
@@ -2004,7 +2005,7 @@ bool QgsOracleProvider::setSubsetString( const QString& theSQL, bool updateFeatu
20042005
}
20052006
qry.finish();
20062007

2007-
if ( mPrimaryKeyType == pktInt && !uniqueData( mQuery, mAttributeFields[ mPrimaryKeyAttrs[0] ].name() ) )
2008+
if ( mPrimaryKeyType == pktInt && !mUseEstimatedMetadata && !uniqueData( mQuery, mAttributeFields[ mPrimaryKeyAttrs[0] ].name() ) )
20082009
{
20092010
mSqlWhereClause = prevWhere;
20102011
return false;

0 commit comments

Comments
 (0)