Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[mssql] Allow compilation of int div expressions
- Loading branch information
|
@@ -83,3 +83,8 @@ QString QgsMssqlExpressionCompiler::castToReal( const QString &value ) const |
|
|
{ |
|
|
return QStringLiteral( "CAST((%1) AS REAL)" ).arg( value ); |
|
|
} |
|
|
|
|
|
QString QgsMssqlExpressionCompiler::castToInt( const QString &value ) const |
|
|
{ |
|
|
return QStringLiteral( "CAST((%1) AS integer)" ).arg( value ); |
|
|
} |
|
@@ -30,6 +30,7 @@ class QgsMssqlExpressionCompiler : public QgsSqlExpressionCompiler |
|
|
Result compileNode( const QgsExpressionNode *node, QString &result ) override; |
|
|
QString quotedValue( const QVariant &value, bool &ok ) override; |
|
|
QString castToReal( const QString &value ) const override; |
|
|
QString castToInt( const QString &value ) const override; |
|
|
|
|
|
}; |
|
|
|
|
|
|
@@ -122,7 +122,7 @@ void QgsMssqlFeatureIterator::BuildStatement( const QgsFeatureRequest &request ) |
|
|
mStatement += QStringLiteral( ",[%1]" ).arg( mSource->mGeometryColName ); |
|
|
} |
|
|
|
|
|
mStatement += QStringLiteral( "FROM [%1].[%2]" ).arg( mSource->mSchemaName, mSource->mTableName ); |
|
|
mStatement += QStringLiteral( " FROM [%1].[%2]" ).arg( mSource->mSchemaName, mSource->mTableName ); |
|
|
|
|
|
bool filterAdded = false; |
|
|
// set spatial filter |
|
|
|
@@ -85,7 +85,6 @@ def uncompiledFilters(self): |
|
|
'\'x\' || "name" IS NOT NULL', |
|
|
'\'x\' || "name" IS NULL', |
|
|
'"name" ~ \'[OP]ra[gne]+\'', |
|
|
'pk = 9 // 4', |
|
|
'false and NULL', |
|
|
'true and NULL', |
|
|
'NULL and false', |
|
|