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

   ### 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
   
   all version
   
   ### What's Wrong?
   
   When enable query sql cache, if we delete some partition(s), the cache will 
not be refreshed and the query will return wrong result.
   
   ### What You Expected?
   
   Query cache should return right result.
   
   ### How to Reproduce?
   
   1. Create a table like this:  
   ```sql
   CREATE TABLE `tbl_test` (
     `siteid` int(11) NOT NULL DEFAULT "10",
     `citycode` smallint(6) NOT NULL DEFAULT "0",
     `username` varchar(32) NOT NULL DEFAULT "",
     `pday` varchar(20) NOT NULL DEFAULT "",
     `pv` bigint(20) SUM NOT NULL DEFAULT "0",
     INDEX siteid_Idx (`siteid`) USING BITMAP COMMENT '创建表加siteid列索引'
   ) ENGINE=OLAP
   AGGREGATE KEY(`siteid`, `citycode`, `username`, `pday`)
   PARTITION BY LIST(`pday`)
   (
       PARTITION `p_20230825` VALUES IN ("20230825"),
       PARTITION `p_20230826` VALUES IN ("20230826"),
       PARTITION `p_20230827` VALUES IN ("20230827")
   )
   DISTRIBUTED BY HASH(`siteid`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "is_being_synced" = "false",
   "storage_format" = "V2",
   "light_schema_change" = "true",
   "disable_auto_compaction" = "false",
   "enable_single_replica_compaction" = "false"
   );    
   ```
   
   2. insert some data:  
   ```sql
   insert into `tbl_test` values(1, 1, 'test', '20230825', 1);
   insert into `tbl_test` values(1, 1, 'test', '20230826', 1);
   insert into `tbl_test` values(1, 1, 'test', '20230827', 1);
   ```
   3. execute a query: `select * from tbl_test`, it will return 3 rows.
   4. delete partition  `p_20230826` by executing `alter table tbl_test drop 
partition p_20230826`.
   5. execute this query again: `select * from tbl_test`, it will return 3 rows 
too (in fact the right result should be 2).
   
   
![image](https://github.com/apache/doris/assets/5926365/95d14580-8044-4f68-b00a-c8539278589e)
   
   
   ### 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-unsubscr...@doris.apache.org.apache.org

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


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

Reply via email to