Skip to content

sql: disallow ALTER COLUMN TYPE for columns stored in secondary indexes#72777

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/debug-alter-column-thing
Nov 16, 2021
Merged

sql: disallow ALTER COLUMN TYPE for columns stored in secondary indexes#72777
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/debug-alter-column-thing

Conversation

@ajwerner
Copy link
Copy Markdown
Contributor

It is broken. After the change, the index, after the change, refers to a column
which is not in the table.

Fixes #72718.
Relates to #72771.

Release note (sql change): The experimental ALTER COLUMN TYPE statement
is no longer permitted when the column is stored in a secondary index. Prior
to this change, that was the only sort of secondary index membership which
was allowed, but the result of the operation was a subtly corrupted table.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@ajwerner
Copy link
Copy Markdown
Contributor Author

This is the first of several PRs to come. I want to add validation that all index members are in the table and I want to make the FastIntMap always return -1 if the entry does not exist.

@ajwerner
Copy link
Copy Markdown
Contributor Author

Loosely relates to #72456 and #72457.

It is broken. After the change, the index, after the change, refers to a column
which is not in the table.

Fixes cockroachdb#72718.
Relates to cockroachdb#72771.

Release note (sql change): The experimental `ALTER COLUMN TYPE` statement
is no longer permitted when the column is stored in a secondary index. Prior
to this change, that was the only sort of secondary index membership which
was allowed, but the result of the operation was a subtly corrupted table.
@ajwerner ajwerner force-pushed the ajwerner/debug-alter-column-thing branch from 5cfbb08 to dccab78 Compare November 15, 2021 20:51
@ajwerner
Copy link
Copy Markdown
Contributor Author

TFTR

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 16, 2021

Build succeeded:

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Nov 16, 2021

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from dccab78 to blathers/backport-release-21.1-72777: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 21.1.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql/logictest: TestLogic failed

3 participants