pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial
https://pingcap.com
Apache License 2.0
36.27k stars 5.72k forks source link

data inconsistency after adding index with local sort #53010

Closed wjhuang2016 closed 1 week ago

wjhuang2016 commented 2 weeks ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `t99d49770` (
  `col_1` tinyint(1) NOT NULL,
  `col_2` text COLLATE utf8_general_ci NOT NULL,
  `col_3` varchar(389) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'BU)u!g*H#bJHV+',
  `col_4` json NOT NULL,
  `col_5` varchar(129) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`col_1`,`col_3`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

insert into t99d49770 values (1, "ngyt)fdZzDmGU4^VZO", "4NvTXylG", "[0.5095598074950872, 0.4243335785604808, 0.20438241643635513]", "I#");

alter table t99d49770 add key idx_2 ( col_1 );

admin check table t99d49770;

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

No error

3. What did you see instead (Required)

mysql> admin check table t99d49770;
ERROR 8223 (HY000): data inconsistency in table: t99d49770, index: idx_2, handle: {1,

4. What is your TiDB version? (Required)

cfbabfa705dbbc97c8e1e00af7f2d2620406304c

tangenta commented 1 week ago

Closed by #53118.