Skip to content
Permalink
Browse files

[mssql] Allow compilation of int div expressions

  • Loading branch information
nyalldawson committed Oct 4, 2018
1 parent 4a687a0 commit 1d9086c75dbf7d5235d05493c0c324a1448bfecf
@@ -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',

0 comments on commit 1d9086c

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