Skip to content

fix(planner): fix case expr with case operator equal - #6950

Merged
mergify[bot] merged 3 commits into
databendlabs:mainfrom
b41sh:fix-expr-case
Aug 3, 2022
Merged

fix(planner): fix case expr with case operator equal#6950
mergify[bot] merged 3 commits into
databendlabs:mainfrom
b41sh:fix-expr-case

Conversation

@b41sh

@b41sh b41sh commented Aug 2, 2022

Copy link
Copy Markdown
Member

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

If the case expression has case_value, compare it with each when_value until one of them is equal.

Fixes #6944

@vercel

vercel Bot commented Aug 2, 2022

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
databend ✅ Ready (Inspect) Visit Preview Sep 3, 2022 at 2:09AM (UTC)

@b41sh
b41sh requested review from sundy-li and xudong963 August 2, 2022 07:23
@mergify mergify Bot added the pr-bugfix this PR patches a bug in codebase label Aug 2, 2022

@xudong963 xudong963 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about adding a test case in to https://github.com/datafuselabs/databend/blob/main/tests/logictest/suites/ydb/select1-1.test

select
       case a+1 when b then 111 when c then 222
        when d then 333  when e then 444 else 555 end as col6
from t1
order by col6;

Comment thread tests/logictest/suites/ydb/select1-1.test
@xudong963

Copy link
Copy Markdown
Contributor

There are still cases with errors in the logic test that need to be handled @b41sh

@b41sh

b41sh commented Aug 2, 2022

Copy link
Copy Markdown
Member Author

There are still cases with errors in the logic test that need to be handled @b41sh

I will fix them.

@mergify
mergify Bot merged commit 269828b into databendlabs:main Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix this PR patches a bug in codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: case when then return wrong results

4 participants