[
https://issues.apache.org/jira/browse/CALCITE-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16568449#comment-16568449
]
Vladimir Sitnikov commented on CALCITE-2438:
--------------------------------------------
{{COALESCE(OR(null, $0), NOT(false))}} was related to {{if
(digests.add(operand.digest))}} access as {{digest}} was {{null}}.
However that did not heal more complicated things like
{noformat}
java.lang.AssertionError: result mismatch: when applied to {$2=false,
$13=false, $3=true, $10=true, $14=NULL}, OR($2, OR(null, $13), <>(OR(false,
MAX(OR(COALESCE($3, null, $10), COALESCE(null, false, $14))), IS DISTINCT
FROM(IS DISTINCT FROM(IS NOT NULL(<>($2, null)), true), true)), <=($14, IS
UNKNOWN(false))), <>($14, true)) yielded NULL,
and OR($2, null, $13, <>(OR(MAX(OR(COALESCE($3, null, $10), COALESCE(null,
false, $14))), IS DISTINCT FROM(IS DISTINCT FROM(IS NOT NULL(<>($2, null)),
true), true)), false), <>($14, true)) yielded true{noformat}
{noformat}{$2=false, $13=false, $3=true, $10=true, $14=NULL}, OR($2, OR(null,
$13), <>(OR(false, MAX(OR(COALESCE($3, null, $10), COALESCE(null, false,
$14))), IS DISTINCT FROM(IS DISTINCT FROM(IS NOT NULL(<>($2, null)), true),
true)), <=($14, IS UNKNOWN(false))), <>($14, true)) yielded NULL,
and OR($2, null, $13, <>(OR(MAX(OR(COALESCE($3, null, $10), COALESCE(null,
false, $14))), IS DISTINCT FROM(IS DISTINCT FROM(IS NOT NULL(<>($2, null)),
true), true)), false), <>($14, true)) yielded true{noformat}
> RexCall#isAlwaysTrue return incorrect result
> ---------------------------------------------
>
> Key: CALCITE-2438
> URL: https://issues.apache.org/jira/browse/CALCITE-2438
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.17.0
> Reporter: pengzhiwei
> Assignee: Julian Hyde
> Priority: Critical
> Attachments: 屏幕快照 2018-08-02 下午7.26.20.png, 屏幕快照 2018-08-02
> 下午7.34.26.png
>
>
> In the expression as followed:
> {code:java}
> ((sal IS NULL) IS NOT NULL) IS FALSE
> {code}
> The RexCall#isAlwaysTrue return true,however the correct answer is false.
> I find the reason is that there is a wrong logic in the isAlwaysTrue,when
> getKind() is IS_NOT_FALSE、IS_FALSE and IS_NOT_FALSE :
> !屏幕快照 2018-08-02 下午7.34.26.png!
> Can you have a check for me,thanks!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)