cloudberry icon indicating copy to clipboard operation
cloudberry copied to clipboard

[Bug] orca count bug

Open yjhjstz opened this issue 4 months ago • 1 comments

Apache Cloudberry version

main

What happened

orca result error

What you think should happen instead

No response

How to reproduce

CREATE TABLE count_empty (a int, b int); CREATE TABLE count_one (a int, b int); INSERT INTO count_one VALUES (0, 0);

-- optimizer=off: SET optimizer=off; SELECT * FROM count_one WHERE count_one.a IN ( SELECT COUNT(*) FROM count_empty WHERE count_one.b = count_empty.b ); a | b ---+--- 0 | 0 (1 row)

-- optimizer=on: SET optimizer=on; SELECT * FROM count_one WHERE count_one.a IN ( SELECT COUNT(*) FROM count_empty WHERE count_one.b = count_empty.b ); a | b ---+--- (0 rows)

Operating System

centos 9

Anything else

No response

Are you willing to submit PR?

  • [x] Yes, I am willing to submit a PR!

Code of Conduct

yjhjstz avatar Aug 12 '25 14:08 yjhjstz

Hi, @yjhjstz welcome!🎊 Thanks for taking the time to point this out.🙌

github-actions[bot] avatar Aug 12 '25 14:08 github-actions[bot]