Skip to content

Commit

Permalink
[fix](Nereids) cast to boolean wrong when constant folding by be (apa…
Browse files Browse the repository at this point in the history
…che#39019)

not add case because be return wrong answer for this

select cast(2.0 as boolean); -- should return 1 not 2
  • Loading branch information
morrySnow authored Aug 8, 2024
1 parent 7ead170 commit 8d4f8b1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public static List<Literal> getResultExpression(DataType type, PValues resultCon
} else if (type.isBooleanType()) {
int num = resultContent.getUint32ValueCount();
for (int i = 0; i < num; ++i) {
Literal literal = BooleanLiteral.of(resultContent.getUint32Value(i) == 1);
Literal literal = BooleanLiteral.of(resultContent.getUint32Value(i) != 0);
res.add(literal);
}
} else if (type.isTinyIntType()) {
Expand Down

0 comments on commit 8d4f8b1

Please sign in to comment.