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 in non clustered PK after load data ...replace into ... #56408

Closed
fzzf678 opened this issue Sep 29, 2024 · 2 comments · Fixed by #56415
Closed

Data inconsistency in non clustered PK after load data ...replace into ... #56408

fzzf678 opened this issue Sep 29, 2024 · 2 comments · Fixed by #56415
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. 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.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. impact/inconsistency incorrect/inconsistency/inconsistent report/customer Customers have encountered this bug. severity/major type/bug The issue is confirmed as a bug. type/regression

Comments

@fzzf678
Copy link
Contributor

fzzf678 commented Sep 29, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

➜  ~ cat /Users/fanzhou/a.csv
1|aa|beijing
1|aa|beijing
1|aa|beijing
1|aa|beijing
2|bb|shanghai
2|bb|shanghai
2|bb|shanghai
3|cc|guangzhou
mysql> create table a(id int, name varchar(20), addr varchar(100), primary key (id) nonclustered);
Query OK, 0 rows affected (0.02 sec)

mysql> load data local infile '/Users/fanzhou/a.csv' replace into table a fields terminated by '|' escaped by '' lines terminated by '\n';
Query OK, 13 rows affected (0.01 sec)
Records: 8  Deleted: 0  Skipped: 0  Warnings: 0

mysql> select count(*) from a;
+----------+
| count(*) |
+----------+
|        3 |
+----------+
1 row in set (0.01 sec)

mysql> select count(*) from a use index();
+----------+
| count(*) |
+----------+
|        8 |
+----------+
1 row in set (0.01 sec)

mysql> admin check table a;
ERROR 8223 (HY000): data inconsistency in table: a, index: PRIMARY, handle: 3, index-values:"" != record-values:"handle: 3, values: [KindInt64 1]"

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

Data consistent, No error

3. What did you see instead (Required)

Data Inconsistency

4. What is your TiDB version? (Required)

master

@fzzf678 fzzf678 added type/bug The issue is confirmed as a bug. component/ddl This issue is related to DDL of TiDB. affects-6.5 This bug affects the 6.5.x(LTS) versions. 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.1 This bug affects the 8.1.x(LTS) versions. labels Sep 29, 2024
@wjhuang2016
Copy link
Member

mysql> show create table te4e81423;
+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table     | Create Table                                                                                                                                                 |
+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| te4e81423 | CREATE TABLE `te4e81423` (
  `col_21` decimal(26,14) NOT NULL,
  UNIQUE KEY `idx_15` (`col_21`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

csv:

0
834382.8322
3290.508
3818.726
409.797
3901
97
95.308
11.71
9.437
355.51
3364
8.11
859.735

@kennedy8312
Copy link

/type regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. 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.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. impact/inconsistency incorrect/inconsistency/inconsistent report/customer Customers have encountered this bug. severity/major type/bug The issue is confirmed as a bug. type/regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants