Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/dsql/BoolNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,24 @@ BoolExprNode* ComparativeBoolNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
literalArg = value;
};

convertLiteralToOperand(procArg1, procArg2);
convertLiteralToOperand(procArg2, procArg1);
// Pattern matching operators (LIKE, CONTAINING, etc) compare strings, so their literals are kept as is
switch (blrOp)
{
case blr_eql:
case blr_neq:
case blr_gtr:
case blr_geq:
case blr_lss:
case blr_leq:
case blr_equiv:
case blr_between:
convertLiteralToOperand(procArg1, procArg2);
convertLiteralToOperand(procArg2, procArg1);

if (blrOp == blr_between)
convertLiteralToOperand(procArg3, procArg1);
if (blrOp == blr_between)
convertLiteralToOperand(procArg3, procArg1);
break;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also add all the pattern matching BLRs to the switch (with just break;) and the default section with fb_assert(false). This would trigger an explicit decision how any newly added BLR comparison op-code should be preprocessed in this routine.


ComparativeBoolNode* node = FB_NEW_POOL(dsqlScratch->getPool()) ComparativeBoolNode(dsqlScratch->getPool(), blrOp,
procArg1,
Expand Down