Skip to content

sql: fix object lookup for ALTER TABLE ... RENAME TO ...#55997

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
jayshrivastava:fix-rename-table-schema-bug
Oct 27, 2020
Merged

sql: fix object lookup for ALTER TABLE ... RENAME TO ...#55997
craig[bot] merged 1 commit intocockroachdb:masterfrom
jayshrivastava:fix-rename-table-schema-bug

Conversation

@jayshrivastava
Copy link
Copy Markdown
Contributor

@jayshrivastava jayshrivastava commented Oct 26, 2020

Previously, ALTER TABLE schema.table RENAME TO schema.existing_table
would fail because the statement would look up the destination table in
the public schema only. This commit fixes this behavior by using
the correct destination schema.

Fixes #55985

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@jayshrivastava jayshrivastava force-pushed the fix-rename-table-schema-bug branch 2 times, most recently from 7cc6fc3 to d1b5c0e Compare October 26, 2020 20:28
@jayshrivastava jayshrivastava marked this pull request as ready for review October 26, 2020 20:37
Previously, ALTER TABLE schema.table RENAME TO schema.existing_table
would fail because the statement would look up the destination table in
the public schema only. This commit fixes this behavior by using
the correct destination schema.

Fixes cockroachdb#55985

Release note: None
Copy link
Copy Markdown
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm_strong:

Reviewed 7 of 7 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @lucy-zhang)

@jayshrivastava
Copy link
Copy Markdown
Contributor Author

bors r=ajwerner

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 27, 2020

Build succeeded:

@craig craig bot merged commit 8652b7a into cockroachdb:master Oct 27, 2020
@jayshrivastava jayshrivastava deleted the fix-rename-table-schema-bug branch October 31, 2020 18:30
@rafiss rafiss added this to the 20.2 milestone Apr 22, 2021
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: unexpected value when renaming table to an existing one

4 participants