Skip to content

Commit

Permalink
Fix indentation in HANA provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Rylov authored and mrylov committed Dec 7, 2020
1 parent 00b7554 commit 471bb80
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
36 changes: 18 additions & 18 deletions src/providers/hana/qgshanaexpressioncompiler.cpp
Expand Up @@ -133,27 +133,27 @@ QgsSqlExpressionCompiler::Result QgsHanaExpressionCompiler::compileNode(
}
break;
case QgsExpressionNode::ntUnaryOperator:
{
const QgsExpressionNodeUnaryOperator *unaryOp = static_cast<const QgsExpressionNodeUnaryOperator *>( node );
switch ( unaryOp->op() )
{
const QgsExpressionNodeUnaryOperator *unaryOp = static_cast<const QgsExpressionNodeUnaryOperator *>( node );
switch ( unaryOp->op() )
case QgsExpressionNodeUnaryOperator::uoNot:
{
case QgsExpressionNodeUnaryOperator::uoNot:
{
Result resRight = compileNode( unaryOp->operand(), result );
if ( "NULL" == result.toUpper() )
{
result.clear();
return Fail;
}
result = "NOT " + result;

return resRight;
}
case QgsExpressionNodeUnaryOperator::uoMinus:
break;
Result resRight = compileNode( unaryOp->operand(), result );
if ( "NULL" == result.toUpper() )
{
result.clear();
return Fail;
}
result = "NOT " + result;

return resRight;
}
case QgsExpressionNodeUnaryOperator::uoMinus:
break;
}
break;
}
break;
case QgsExpressionNode::ntBinaryOperator:
{
const QgsExpressionNodeBinaryOperator *binOp( static_cast<const QgsExpressionNodeBinaryOperator *>( node ) );
Expand All @@ -165,10 +165,10 @@ QgsSqlExpressionCompiler::Result QgsHanaExpressionCompiler::compileNode(

if ( resLeft == Fail || resRight == Fail )
return Fail;

// NULL can not appear on the left, only as part of IS NULL or IS NOT NULL
if ( "NULL" == opLeft.toUpper() )
return Fail;

// NULL can only be on the right for IS and IS NOT
if ( "NULL" == opRight.toUpper() &&
( binOp->op() != QgsExpressionNodeBinaryOperator::boIs && binOp->op() != QgsExpressionNodeBinaryOperator::boIsNot ) )
Expand Down
20 changes: 10 additions & 10 deletions src/providers/hana/qgshanafeatureiterator.cpp
Expand Up @@ -377,11 +377,11 @@ QString QgsHanaFeatureIterator::buildSqlQuery( const QgsFeatureRequest &request
{
QgsHanaExpressionCompiler compiler = QgsHanaExpressionCompiler( mSource );
QgsSqlExpressionCompiler::Result result = compiler.compile( request.filterExpression() );
switch(result)
{
case QgsSqlExpressionCompiler::Result::Complete:
case QgsSqlExpressionCompiler::Result::Partial:
switch ( result )
{
case QgsSqlExpressionCompiler::Result::Complete:
case QgsSqlExpressionCompiler::Result::Partial:
{
QString filterExpr = compiler.result();
if ( !filterExpr.isEmpty() )
{
Expand All @@ -391,13 +391,13 @@ QString QgsHanaFeatureIterator::buildSqlQuery( const QgsFeatureRequest &request
mExpressionCompiled = ( result == QgsSqlExpressionCompiler::Result::Complete );
mCompileStatus = ( mExpressionCompiled ? Compiled : PartiallyCompiled );
}
}
break;
case QgsSqlExpressionCompiler::Result::Fail:
QgsDebugMsg(QStringLiteral("Unable to compile filter expression: '%1'")
.arg(request.filterExpression()->expression()).toStdString().c_str());
}
break;
case QgsSqlExpressionCompiler::Result::Fail:
QgsDebugMsg( QStringLiteral( "Unable to compile filter expression: '%1'" )
.arg( request.filterExpression()->expression() ).toStdString().c_str() );
break;
case QgsSqlExpressionCompiler::Result::None:
case QgsSqlExpressionCompiler::Result::None:
break;
}
if ( result != QgsSqlExpressionCompiler::Result::Complete )
Expand Down

0 comments on commit 471bb80

Please sign in to comment.