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 and index are inconsistent after adding multi-value index #51162

Closed
wjhuang2016 opened this issue Feb 19, 2024 · 1 comment · Fixed by #51884
Closed

data and index are inconsistent after adding multi-value index #51162

wjhuang2016 opened this issue Feb 19, 2024 · 1 comment · Fixed by #51884
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.0 component/ddl This issue is related to DDL of TiDB. fuzz/randomtest severity/critical type/bug The issue is confirmed as a bug.

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `tl` (
  `col_42` json NOT NULL,
  `col_43` tinyint(1) DEFAULT NULL,
  `col_44` char(168) CHARACTER SET gbk COLLATE gbk_bin DEFAULT NULL,
  `col_45` json DEFAULT NULL,
  `col_46` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `col_47` char(43) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'xW2YNb99pse4)',
  `col_48` time NOT NULL DEFAULT '12:31:25',
  PRIMARY KEY (`col_47`,`col_46`(2)) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `tl` VALUES ('[\"01qHMy8yycbq2v1CZ80kiIECEQFLXYsnM0tpVh9vbx71DMpaPdp6hBkrpTodkXVt\", \"dGugZHV3pmqjLSdICAYbiwFGZsYWX9MrzgSGCslmEsfFzXYOiXyE0YMS1TSfnX5R\", \"Ypz8Jj0hBSBQbiWd3LbPRV2qvSEAxV8rlXnxpn93nXmFyMJkCQzyhtNn0FUwH6Ce\", \"Yf6kag9ruOT04V8AHT6NYhCNIa2CYZDVg8zWaxxHFm0GPAJh0e6Mc5Upa0EAp1Sr\", \"ljrRnPUdxJNkWxmkn4K25YeFwVtedGtLDrWlWYZyqt2Shpfg4p7jroOwbOZHuHiE\"]',0,'釸7鈡w歀痂暰苕rv)Ts','[5661899762065804824, 3294089805449875423, 2378579521053711229, 6262068190112960080]','Wxup81婱鍋cH爀
2潺檛楍1N7','2ZNeu2n5-2+Q3qYp','10:14:20'), ('[\"iOl0B9dVMoNYk8Qroj6JTwm0MaCJmr5qnQzdjMtaoDar4jGe6q20HAyVu3GacogW\", \"PBy3AXmGhzJMBX3Ow9INdeATLld8bVVjrIUVTlspzpHMZPuFGlEsDeRN6JOLqRLy\", \"jyr0odf7TOhLpuejrfbvsBbjqCchHSKEFZ079c5KUhu0FIuoqm6tBNbWCBb0xb3c\", \"PmPE8oZf73Zwffi97D7AaQM5g0xameUwPvO15LEUPVlF4iiDVsXyGMESSbEzR5L7\", \"4y0WxQIzPw217QeSXCySsK3pGbHdMxx6ETtIZQfGI8v7Pq9Rxhwkslr1ih8M7Dok\"]',0,'','[2142591371645505560, 2975660707908269211]','','aC794Ir-)iJZr&a','02:30:55'), ('[\"je9igPre8L6VdmtEtVDwxCgTqcuSKdqdO4fheHXRJOQLojiHx4F8cXmFpiYq9955\", \"zPjn7sAeMVLLGE3o9lpnZai26ad8qxHNQF6CSsMshFbP2fDuByV3SYxhxkVwIQd3\", \"Etj8PQZe64XWTbBElIEhWA3F3OcytxNMLvxQqr4miDxoK96Q8fGjBg34H3i4y3V5\", \"IDNAQjueBRQyUE285zoPSMhIvVKrxbiXAVvge0iC9AaEFK18Gh3sign84Nu6M3Ar\", \"MK79tEDnyHn2Cmw4W55hEzAsKvqUTZbViv6UyiEqnUE9jpBOnMEDQbq6yQip4qm3\"]',1,')譺
)RK5','[1760220588316922379, 4921535278728445755, 5623214347361271244, 5272407040485486430, 9017432485293265763]','RLFF','gS','06:27:28');

alter table tl add index idx_16(`col_48`,(cast(`col_45` as signed array)),`col_46`(5));

admin check table tl;

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

No error

3. What did you see instead (Required)

mysql> admin check table tl;
ERROR 8134 (HY000): data inconsistency in table: tl, index: idx_16, col: col_46, handle: "{\x0e+\x10j\x0fd\x0e\x8b\x10\x1f\x0e+\x0fd\x0e.\x02!\x0e+\x04(\x0f\xb4\x0e,\x0f\xb4\x10^\x0f\xa7, \x10Q\x10Z}", index-values:"KindString Wx" != record-values:"KindString Wxup8", compare err:<nil>

4. What is your TiDB version? (Required)

4e41699

@wjhuang2016 wjhuang2016 added type/bug The issue is confirmed as a bug. fuzz/randomtest labels Feb 19, 2024
@jebter jebter added severity/critical component/ddl This issue is related to DDL of TiDB. labels Feb 20, 2024
@ywqzzy
Copy link
Contributor

ywqzzy commented Mar 13, 2024

image

Do we have a Planner bug, too?

@ywqzzy ywqzzy added affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. and removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 labels Mar 21, 2024
ti-chi-bot bot pushed a commit that referenced this issue Mar 21, 2024
ti-chi-bot bot pushed a commit that referenced this issue Mar 21, 2024
ti-chi-bot bot pushed a commit that referenced this issue Apr 17, 2024
ti-chi-bot bot pushed a commit that referenced this issue May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.0 component/ddl This issue is related to DDL of TiDB. fuzz/randomtest severity/critical type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants