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

replace on old format row with new collation make prefix secondary index inconsistent #23708

Closed
wjhuang2016 opened this issue Mar 30, 2021 · 2 comments · Fixed by #23751
Closed
Assignees
Labels
severity/critical sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.

Comments

@wjhuang2016
Copy link
Member

wjhuang2016 commented Mar 30, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

log6.sql.zip
source log6.sql;
admin check table tbl_2;

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

No error.

3. What did you see instead (Required)

mysql> admin check table tbl_2;
ERROR 1105 (HY000): handle 13, index:types.Datum{k:0x5, decimal:0x0, length:0x0, i:0, collation:"binary", b:[]uint8{0x6c, 0x77}, x:interface {}(nil)} != record:<nil>

4. What is your TiDB version? (Required)

master, fresh build.

@wjhuang2016 wjhuang2016 added the type/bug The issue is confirmed as a bug. label Mar 30, 2021
@lysu lysu added the sig/transaction SIG:Transaction label Mar 30, 2021
@lysu lysu changed the title admin check failed replace on old format row with new collation make prefix secondary index inconsistent Mar 30, 2021
@lysu
Copy link
Contributor

lysu commented Mar 30, 2021

min reproduce script

start a cluster with new collation enabled

need set global tidb_row_format_version=1 and reconnect (need old row format, so need real tikv instead of unistore)

drop table if exists t;
create table t(c1 int primary key, c3 text, key idx1(c3(5)))collate utf8_unicode_ci;
insert into t select 1, 'V';
replace into t(c1, c3) values (1, 'rOCRvfiJi');
admin check table t;

it require:

  • new collation
  • prefix index
  • old row format

not require:

  • clustered index

so it maybe also affect on 4.0

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/critical sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants