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

   ### 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
   
    2.0.9
   
   ### What's Wrong?
   
   使用 where 1=1 作为条件执行 delete 语句后,相同主键的数据就再也无法更新和查询了
   
   ### What You Expected?
   
   使用 where 1=1 作为条件执行 delete 语句后,期望得到两种结果:
   1. 直接得到报错,不允许执行
   2. 正常执行,但是相同主键的数据可以重复插入或者更新
   
   ### How to Reproduce?
   
    1. create table
    3. insert one record
    4. delete with where 1=1
    5. insert before record
   
   ```
   DROP TABLE IF EXISTS `test_delete_tb`;
   CREATE TABLE `test_delete_tb`
   (
       `user_id`   bigint(20) NOT NULL COMMENT '主键ID',
       `user_no`   bigint(20) NOT NULL COMMENT '主键ID2',
       `user_name` varchar(255)    NOT NULL COMMENT '名称'
   
   )ENGINE = OLAP UNIQUE KEY(`user_id`, `user_no`)
   COMMENT '测试where1=1'
   DISTRIBUTED BY HASH(`user_no`) BUCKETS AUTO
   PROPERTIES (
   "enable_unique_key_merge_on_write" = "true",
   "light_schema_change" = "true",
   "disable_auto_compaction" = "false",
   "enable_single_replica_compaction" = "false"
   );;
   
   
   insert into test_delete_tb (`user_id`, `user_no`, `user_name`)
   values (1,1,'AB');
   select * from test_delete_tb;
   
   # It is ok
   #delete from test_delete_tb where  `user_id`>0;
   
   # Crash
   delete from test_delete_tb where 1=1 and `user_id`>0;
   insert into test_delete_tb (`user_id`, `user_no`, `user_name`)
   values (1,1,'AB');
   select * from test_delete_tb;
   ```
   
   ### 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