Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data inconsistency is reported when query with for update clause #44123

Closed
wjhuang2016 opened this issue May 23, 2023 · 1 comment · Fixed by #44139
Closed

data inconsistency is reported when query with for update clause #44123

wjhuang2016 opened this issue May 23, 2023 · 1 comment · Fixed by #44139
Assignees

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `ccf0ed15` (
  `f9e69bc7` bigint(20) DEFAULT '1112823069779687543',
  `d33b6c1b` decimal(41,16) DEFAULT '5518242590970756357909774.8550717763805231',
  `56231d4d` set('35','pi','dqurb','yita3','kczu','a','t8','4d','bh4qs','lk9a','75k') DEFAULT '35,pi,kczu,a,t8,4d,bh4qs,75k',
  UNIQUE KEY `d2200701` (`d33b6c1b`,`f9e69bc7`),
  UNIQUE KEY `9efc4c6b` (`f9e69bc7`),
  KEY `8a590049` (`56231d4d`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_chinese_ci COMMENT='46791f67'
PARTITION BY HASH (`f9e69bc7`) PARTITIONS 5;
INSERT INTO `ccf0ed15` VALUES
(-7801043551743108407,4626.1410000000000000,'yita3'),
(5755921862464422919,0.4787000000000000,'dqurb'),
(6818225316668061803,5800.0000000000000000,'35'),
(1112823069779687543,5518242590970756357909774.8550717763805231,'dqurb'),
(3823184061824785364,31.7690000000000000,'bh4qs'),
(6741424187029746717,7264.0000000000000000,'pi'),
(7056863346120328265,17.5560000000000000,'dqurb'),
(5552107058771389209,7444.4900000000000000,'a');

select  /*+ use_index_merge( `ccf0ed15` ) */   `ccf0ed15`.`56231d4d` as r0 from `ccf0ed15`    order by r0 limit 82 for update;

2. What did you expect to see? (Required)

No error

3. What did you see instead (Required)

mysql> select  /*+ use_index_merge( `ccf0ed15` ) */   `ccf0ed15`.`56231d4d` as r0 from `ccf0ed15`    order by r0 limit 82 for update;
ERROR 8133 (HY000): data inconsistency in table: ccf0ed15, index: 8a590049, index-count:2 != record-count:1

4. What is your TiDB version? (Required)

master

@wjhuang2016 wjhuang2016 added type/bug This issue is a bug. fuzz/schrddl labels May 23, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels May 24, 2023
@Defined2014 Defined2014 self-assigned this May 24, 2023
@Defined2014 Defined2014 removed may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels May 24, 2023
@Defined2014
Copy link
Contributor

Defined2014 commented May 24, 2023

I think it only happens when static-prune with set(The encode type with set from tikv will equals to EncodeType::TypeDefault), so change it to moderate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants