ChaseHuangxu opened a new issue, #17705:
URL: https://github.com/apache/doris/issues/17705

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   Apache Doris 1.2.2 RELEASE
   
   ### What's Wrong?
   
   I'm trying to add Apache Doris support to SQLancer, this may be a logic bug 
found by @[SQLancer](https://github.com/sqlancer/sqlancer).
   
   You can reproduce this error from the following steps.
   
   1. `CREATE TABLE t0(c0 BOOLEAN DEFAULT 'false') DISTRIBUTED BY RANDOM 
PROPERTIES ("replication_num" = "1");`
   
   2. `INSERT INTO t0 (c0) VALUES (DEFAULT), ('false'),('true'),(DEFAULT), 
('true'), (DEFAULT),(DEFAULT), ('false');`
   The current status of table t0 is as follows
   <img width="202" alt="image" 
src="https://user-images.githubusercontent.com/91189188/224538317-d4665ea9-022e-4eb6-b894-21fbcc9d33f7.png";>
   
   3. `SELECT t0.c0 FROM t0;`
   
   **This SQL returns 8 records**, it's correct answer
   <img width="206" alt="image" 
src="https://user-images.githubusercontent.com/91189188/224538365-b11b3052-ce7a-47f4-914d-e04c69113301.png";>
   
   4. When we add the where condition to the SQL in the third step, divide it 
into three cases according to c0, not c0, c0 is null, and union all the 
results, we find that **14 records are returned, which is inconsistent with 
expectations**.
   
   `SELECT t0.c0 FROM t0 WHERE t0.c0 
   UNION ALL 
   SELECT t0.c0 FROM t0 WHERE (NOT t0.c0) 
   UNION ALL 
   SELECT t0.c0 FROM t0 WHERE ((t0.c0) IS NULL);
   `
   
   <img width="402" alt="image" 
src="https://user-images.githubusercontent.com/91189188/224538505-745fdf23-d597-4276-8946-1de010789e92.png";>
   
   
   
   ### What You Expected?
   
   Two similar QUERYs should return the same results
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] 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]

Reply via email to