Skip to content
Permalink
Browse files

fix oracle provider build

  • Loading branch information
jef-n committed Jun 5, 2017
1 parent 63083ab commit 05d9f92d99019049424be31a3a8ad36b0aece354
Showing with 10 additions and 7 deletions.
  1. +9 −6 src/providers/oracle/qgsoracleprovider.cpp
  2. +1 −1 src/providers/oracle/qgsoracleprovider.h
@@ -1046,12 +1046,12 @@ QVariant QgsOracleProvider::minimumValue( int index ) const
}

// Returns the list of unique values of an attribute
void QgsOracleProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, int limit ) const
QSet<QVariant> QgsOracleProvider::uniqueValues( int index, int limit ) const
{
if ( !mConnection )
return;
QSet<QVariant> uniqueValues;

uniqueValues.clear();
if ( !mConnection )
return uniqueValues;

try
{
@@ -1081,17 +1081,20 @@ void QgsOracleProvider::uniqueValues( int index, QList<QVariant> &uniqueValues,
QgsMessageLog::logMessage( tr( "Unable to execute the query.\nThe error message from the database was:\n%1.\nSQL: %2" )
.arg( qry.lastError().text() )
.arg( qry.lastQuery() ), tr( "Oracle" ) );
return;
return QSet<QVariant>();
}

while ( qry.next() )
{
uniqueValues.append( qry.value( 0 ) );
uniqueValues << qry.value( 0 );
}
}
catch ( OracleFieldNotFound )
{
return QSet<QVariant>();
}

return uniqueValues;
}

// Returns the maximum value of an attribute
@@ -128,7 +128,7 @@ class QgsOracleProvider : public QgsVectorDataProvider

QVariant minimumValue( int index ) const override;
QVariant maximumValue( int index ) const override;
virtual void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 ) const override;
virtual QSet<QVariant> uniqueValues( int index, int limit = -1 ) const override;
bool isValid() const override;
QgsAttributeList pkAttributeIndexes() const override { return mPrimaryKeyAttrs; }
QVariant defaultValue( QString fieldName, QString tableName = QString::null, QString schemaName = QString::null );

0 comments on commit 05d9f92

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