Skip to content

Commit f2e3d53

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

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
@@ -582,13 +582,14 @@ bool QgsOracleProvider::loadFields()
582582

583583
qry.finish();
584584

585-
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" )
585+
if ( exec( qry, QString( "SELECT column_name,comments FROM all_col_comments t WHERE t.owner=%1 AND t.table_name=%2" )
586586
.arg( quotedValue( mOwnerName ) )
587-
.arg( quotedValue( mTableName ) )
588-
.arg( quotedValue( mGeometryColumn ) ) ) )
587+
.arg( quotedValue( mTableName ) ) ) )
589588
{
590589
while ( qry.next() )
591590
{
591+
if( qry.value( 0 ).toString() == mGeometryColumn )
592+
continue;
592593
comments.insert( qry.value( 0 ).toString(), qry.value( 1 ).toString() );
593594
}
594595
}
@@ -2153,7 +2154,7 @@ bool QgsOracleProvider::setSubsetString( const QString& theSQL, bool updateFeatu
21532154
}
21542155
qry.finish();
21552156

2156-
if ( mPrimaryKeyType == pktInt && !uniqueData( mQuery, mAttributeFields.at( mPrimaryKeyAttrs[0] ).name() ) )
2157+
if ( mPrimaryKeyType == pktInt && !mUseEstimatedMetadata && !uniqueData( mQuery, mAttributeFields.at( mPrimaryKeyAttrs[0] ).name() ) )
21572158
{
21582159
mSqlWhereClause = prevWhere;
21592160
return false;

0 commit comments

Comments
 (0)
Please sign in to comment.