Skip to content

Commit a62fdb0

Browse files
committedNov 16, 2016
oracle provider: fix retrieval of column comments for geometryless tables (fixes #15853)
1 parent 04e02af commit a62fdb0

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

585585
qry.finish();
586586

587-
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" )
587+
if ( exec( qry, QString( "SELECT column_name,comments FROM all_col_comments t WHERE t.owner=%1 AND t.table_name=%2" )
588588
.arg( quotedValue( mOwnerName ) )
589-
.arg( quotedValue( mTableName ) )
590-
.arg( quotedValue( mGeometryColumn ) ) ) )
589+
.arg( quotedValue( mTableName ) ) ) )
591590
{
592591
while ( qry.next() )
593592
{
593+
if( qry.value( 0 ).toString() == mGeometryColumn )
594+
continue;
594595
comments.insert( qry.value( 0 ).toString(), qry.value( 1 ).toString() );
595596
}
596597
}
@@ -2113,7 +2114,7 @@ bool QgsOracleProvider::setSubsetString( const QString& theSQL, bool updateFeatu
21132114
}
21142115
qry.finish();
21152116

2116-
if ( mPrimaryKeyType == pktInt && !uniqueData( mQuery, mAttributeFields[ mPrimaryKeyAttrs[0] ].name() ) )
2117+
if ( mPrimaryKeyType == pktInt && !mUseEstimatedMetadata && !uniqueData( mQuery, mAttributeFields[ mPrimaryKeyAttrs[0] ].name() ) )
21172118
{
21182119
mSqlWhereClause = prevWhere;
21192120
return false;

0 commit comments

Comments
 (0)
Please sign in to comment.