mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
Add compiler setting check to order by compilation
This commit is contained in:
parent
a17714247e
commit
e555323f34
@ -116,6 +116,8 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
|
||||
|
||||
mOrderByCompiled = true;
|
||||
|
||||
if ( QSettings().value( "/qgis/compileExpressions", true ).toBool() )
|
||||
{
|
||||
Q_FOREACH ( const QgsFeatureRequest::OrderByClause& clause, request.orderBys() )
|
||||
{
|
||||
QgsPostgresExpressionCompiler compiler = QgsPostgresExpressionCompiler( source );
|
||||
@ -135,10 +137,17 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
|
||||
// will still be sent and used to pre-sort so the local
|
||||
// CPU can use its cycles for fine-tuning.
|
||||
mOrderByCompiled = false;
|
||||
limitAtProvider = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mOrderByCompiled = false;
|
||||
}
|
||||
|
||||
if ( !mOrderByCompiled )
|
||||
limitAtProvider = false;
|
||||
|
||||
bool success = declareCursor( whereClause, limitAtProvider ? mRequest.limit() : -1, false, orderByParts.join( "," ) );
|
||||
if ( !success && useFallbackWhereClause )
|
||||
|
@ -121,6 +121,8 @@ QgsSpatiaLiteFeatureIterator::QgsSpatiaLiteFeatureIterator( QgsSpatiaLiteFeature
|
||||
|
||||
mOrderByCompiled = true;
|
||||
|
||||
if ( QSettings().value( "/qgis/compileExpressions", true ).toBool() )
|
||||
{
|
||||
Q_FOREACH ( const QgsFeatureRequest::OrderByClause& clause, request.orderBys() )
|
||||
{
|
||||
QgsSpatiaLiteExpressionCompiler compiler = QgsSpatiaLiteExpressionCompiler( source );
|
||||
@ -145,10 +147,17 @@ QgsSpatiaLiteFeatureIterator::QgsSpatiaLiteFeatureIterator( QgsSpatiaLiteFeature
|
||||
// will still be sent and used to pre-sort so the local
|
||||
// CPU can use its cycles for fine-tuning.
|
||||
mOrderByCompiled = false;
|
||||
limitAtProvider = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mOrderByCompiled = false;
|
||||
}
|
||||
|
||||
if ( !mOrderByCompiled )
|
||||
limitAtProvider = false;
|
||||
|
||||
// preparing the SQL statement
|
||||
bool success = prepareStatement( whereClause, limitAtProvider ? mRequest.limit() : -1, orderByParts.join( "," ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user