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

ddl: move public hidden columns to a right position #113

Merged
merged 2 commits into from
Jun 15, 2022

Conversation

tangenta
Copy link
Owner

@tangenta tangenta commented Jun 15, 2022

What problem does this PR solve?

Issue Number: close #110

Problem Summary:

  • For onCreateIndex(), we can't update the hidden columns state step by step(e.g, from none to delete-only), because the non-public columns are ignored in the update assignments list construction(buildUpdateList). As a result, rebuildIndices() panic because the touched array does not contain the index(in delete-only state) columns. See ddl: fix expression index with insert causes losing index data pingcap/tidb#26248.
  • We can't change the implementation of TableInfo.Cols() because "Columns[xxx.Offset]" is used everywhere. It is easy to make mistakes.
  • We have to keep the assumption of "the public columns always come first in TableInfo.Columns". fix TestSchemaChangeForDropColumnsWithIndexes #45 and this PR follow this assumption.

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@tangenta tangenta merged commit 6b891eb into multi-schema-change Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add expression index in multi-schema change panic
2 participants