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

index data may be lost when creating expression index #26213

Closed
wjhuang2016 opened this issue Jul 13, 2021 · 4 comments · Fixed by #26248
Closed

index data may be lost when creating expression index #26213

wjhuang2016 opened this issue Jul 13, 2021 · 4 comments · Fixed by #26248
Assignees
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@wjhuang2016
Copy link
Member

wjhuang2016 commented Jul 13, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `t` (
  `a` int(11) DEFAULT NULL,
  `b` int(11) DEFAULT NULL
);

insert into t many rows (about 1 000 000)
/* DDL */ alter table t add index id2xx((b+1));
                                    /* txn during DDL */ begin pessimistic;
                                    /* txn during DDL */ insert into t values (52000003, 503);
                                    /* txn  during DDL */  commit;
/* DDL */ finish DDL
mysql> admin check table t;
ERROR 8134 (HY000): col _V$_id2xx_0, handle 686873, index:types.Datum{k:0x0, decimal:0x0, length:0x0, i:0, collation:"", b:[]uint8(nil), x:interface {}(nil)} != record:types.Datum{k:0x1, decimal:0x0, length:0x0, i:504, collation:"", b:[]uint8(nil), x:interface {}(nil)}, compare err:<nil>

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

No error

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

master

@wjhuang2016 wjhuang2016 added the type/bug The issue is confirmed as a bug. label Jul 13, 2021
@ChenPeng2013
Copy link
Contributor

because expression index is experimental feature, severity is set to major

@cfzjywxk
Copy link
Contributor

@wjhuang2016
The current implementation of transaction amend is not compatible with expression index, it's needed to reject the amend path for expression index at https://github.com/pingcap/tidb/blob/master/session/schema_amender.go#L220.Also some compatibility test case are needed to verify the rejection.

@wjhuang2016 wjhuang2016 changed the title index data may be lost when creating expression index with tidb_enable_amend_pessimistic_txn=on index data may be lost when creating expression index Jul 14, 2021
@wjhuang2016
Copy link
Member Author

It has nothing to do with amending txn.

@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/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants