my-ship-it opened a new issue, #1948: URL: https://github.com/apache/cloudberry/issues/1948
### Apache Cloudberry version main branch (recent build) ### What happened With ORCA enabled, a query filtering on a column that is only an `INCLUDE` column of an index fails at execution time with an internal error: ``` ERROR: bogus index qualification (nodeIndexscan.c:1250) ``` ORCA appears to generate an index scan on `bogus_i` and pushes `c1` into the index qualification, but `c1` is a non-key `INCLUDE` column and cannot be used as an index qual. With `optimizer = off` the query returns the correct 2 rows. Found by SQLancer. ### What you think should happen instead The query should return the two rows where `c1` is true, with either optimizer. ### How to reproduce ```sql CREATE TABLE bogus_t (c0 boolean, c1 boolean); CREATE INDEX bogus_i ON bogus_t (c0) INCLUDE (c1); INSERT INTO bogus_t VALUES (true, true), (false, true), (true, false); SET optimizer = on; SELECT * FROM bogus_t WHERE c1; -- ERROR: bogus index qualification (nodeIndexscan.c:1250) SET optimizer = off; SELECT * FROM bogus_t WHERE c1; -- 2 rows ``` ### Operating System Linux ### Anything else Found while running SQLancer against Cloudberry. See the related [DISCUSS] thread on dev@ about adopting SQLancer for continuous testing. ### Are you willing to submit PR? - [x] Yes, I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
