Skip to content
Permalink
Browse files

[mssql] Fix integer division compilation

Makes sql server provider pass conformance tests again!
  • Loading branch information
nyalldawson committed Oct 4, 2018
1 parent 3df8c75 commit 4a687a07f7df8227e84403784a6fbb7b2b22edd1
@@ -18,7 +18,7 @@

QgsMssqlExpressionCompiler::QgsMssqlExpressionCompiler( QgsMssqlFeatureSource *source )
: QgsSqlExpressionCompiler( source->mFields,
QgsSqlExpressionCompiler::LikeIsCaseInsensitive | QgsSqlExpressionCompiler::CaseInsensitiveStringMatch )
QgsSqlExpressionCompiler::LikeIsCaseInsensitive | QgsSqlExpressionCompiler::CaseInsensitiveStringMatch | QgsSqlExpressionCompiler::IntegerDivisionResultsInInteger )
{

}
@@ -78,3 +78,8 @@ QString QgsMssqlExpressionCompiler::quotedValue( const QVariant &value, bool &ok
return QgsSqlExpressionCompiler::quotedValue( value, ok );
}
}

QString QgsMssqlExpressionCompiler::castToReal( const QString &value ) const
{
return QStringLiteral( "CAST((%1) AS REAL)" ).arg( value );
}
@@ -29,6 +29,7 @@ class QgsMssqlExpressionCompiler : public QgsSqlExpressionCompiler
protected:
Result compileNode( const QgsExpressionNode *node, QString &result ) override;
QString quotedValue( const QVariant &value, bool &ok ) override;
QString castToReal( const QString &value ) const override;

};

0 comments on commit 4a687a0

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