You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "nextdreamblue (via GitHub)" <gi...@apache.org> on 2023/02/27 07:45:15 UTC

[GitHub] [doris] nextdreamblue opened a new issue, #17183: [Bug] delete from with is null predicate and then query will get wrong result with is not null predicate

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

   ### 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
   
   master
   
   ### What's Wrong?
   
   ```
   CREATE TABLE `test111` (
     `k1` bigint(20) NULL,
     `k2` largeint(40) NULL,
     `k3` largeint(40) NULL
   ) ENGINE=OLAP
   AGGREGATE KEY(`k1`, `k2`, `k3`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`k1`) BUCKETS 1
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "in_memory" = "false",
   "storage_format" = "V2",
   "light_schema_change" = "true",
   "disable_auto_compaction" = "true"
   );
   
   
   truncate table test111;
   
   insert into test111 values(0,1,11),(0,1,22),(0,1,33),(0,1,44),(0,1,55),(0,1,66),(0,1,77),(0,1,88),(0,1,99),(0,1,100),(0,1,101),(0,1,102),(0,1,11),(0,1,122),(0,1,133),(0,1,144),(0,1,155),(0,1,166),(0,1,177),(0,1,188),(0,1,199),(0,1,200),(0,1,201),(0,1,202);
   
   ```
   
   执行delete from 然后查询,查询结果不正确
   
   ```
   MySQL [test]> delete from test111 where k2 is null;
   Query OK, 0 rows affected (0.04 sec)
   {'label':'delete_57381566-4b1a-411e-ba14-9d9901496c6b', 'status':'VISIBLE', 'txnId':'12242'}
   
   MySQL [test]> select k2,k3 from test111;
   +------+------+
   | k2   | k3   |
   +------+------+
   | 1    | 11   |
   | 1    | 22   |
   | 1    | 33   |
   | 1    | 44   |
   | 1    | 55   |
   | 1    | 66   |
   | 1    | 77   |
   | 1    | 88   |
   | 1    | 99   |
   | 1    | 100  |
   | 1    | 101  |
   | 1    | 102  |
   | 1    | 122  |
   | 1    | 133  |
   | 1    | 144  |
   | 1    | 155  |
   | 1    | 166  |
   | 1    | 177  |
   | 1    | 188  |
   | 1    | 199  |
   | 1    | 200  |
   | 1    | 201  |
   | 1    | 202  |
   +------+------+
   23 rows in set (0.01 sec)
   
   MySQL [test]> select k2,k3 from test111 where k2 is not null;
   Empty set (0.01 sec)
   
   ```
   
   ### What You Expected?
   
   返回正确的结果
   
   ### How to Reproduce?
   
   ```
   CREATE TABLE `test111` (
     `k1` bigint(20) NULL,
     `k2` largeint(40) NULL,
     `k3` largeint(40) NULL
   ) ENGINE=OLAP
   AGGREGATE KEY(`k1`, `k2`, `k3`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`k1`) BUCKETS 1
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "in_memory" = "false",
   "storage_format" = "V2",
   "light_schema_change" = "true",
   "disable_auto_compaction" = "true"
   );
   
   
   truncate table test111;
   
   insert into test111 values(0,1,11),(0,1,22),(0,1,33),(0,1,44),(0,1,55),(0,1,66),(0,1,77),(0,1,88),(0,1,99),(0,1,100),(0,1,101),(0,1,102),(0,1,11),(0,1,122),(0,1,133),(0,1,144),(0,1,155),(0,1,166),(0,1,177),(0,1,188),(0,1,199),(0,1,200),(0,1,201),(0,1,202);
   
   delete from test111 where k2 is null;
   
   select k2,k3 from test111;
   
   select k2,k3 from test111 where k2 is not null;
   
   truncate table test111;
   
   insert into test111 values(0,null,11),(0,null,22),(0,null,33),(0,null,44),(0,null,55),(0,null,66),(0,null,77),(0,null,88),(0,null,99),(0,null,100),(0,null,101),(0,null,102),(0,null,11),(0,null,122),(0,null,133),(0,null,144),(0,null,155),(0,null,166),(0,null,177),(0,null,188),(0,null,199),(0,null,200),(0,null,201),(0,null,202);
   
   delete from test111 where k2 is not null;
   
   select k2,k3 from test111;
   
   select k2,k3 from test111 where k2 is null;
   
   ```
   
   两种带where的查询都返回错误数据
   
   ### Anything Else?
   
   _No response_
   
   ### 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: commits-unsubscribe@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] xy720 closed issue #17183: [Bug] delete from with is null predicate and then query will get wrong result with is not null predicate

Posted by "xy720 (via GitHub)" <gi...@apache.org>.
xy720 closed issue #17183: [Bug] delete from with is null predicate and then query will get wrong result with is not null predicate
URL: https://github.com/apache/doris/issues/17183


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org