Skip to content

sql: disallow cross-database type references in CTAS#105579

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
chengxiong-ruan:20230626-disallow-cross-db-type-ref-in-ctas
Jun 27, 2023
Merged

sql: disallow cross-database type references in CTAS#105579
craig[bot] merged 1 commit intocockroachdb:masterfrom
chengxiong-ruan:20230626-disallow-cross-db-type-ref-in-ctas

Conversation

@chengxiong-ruan
Copy link
Copy Markdown
Contributor

Fixes: #105393

Release note (bug fix): reviously, cross-database type references could sneaked in through CREATE TABLE...AS statements if the source table is from another database and any of its columns is of a user defined type. This introduced bug where the source table can be dropped and type could not be found for the CTAS table. This commit disallow such CTAS as a fix.

Fixes: cockroachdb#105393

Release note (bug fix): reviously, cross-database type references
could sneaked in through `CREATE TABLE...AS` statements if the
source table is from another database and any of its columns is of
a user defined type. This introduced bug where the source table
can be dropped and type could not be found for the CTAS table.
This commit disallow such CTAS as a fix.
@chengxiong-ruan chengxiong-ruan requested a review from a team as a code owner June 26, 2023 20:48
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@chengxiong-ruan chengxiong-ruan added backport-22.2.x backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only labels Jun 26, 2023
Copy link
Copy Markdown

@postamar postamar left a comment

Choose a reason for hiding this comment

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

Yikes! Good catch.

@chengxiong-ruan
Copy link
Copy Markdown
Contributor Author

TFTR!
bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 27, 2023

Build succeeded:

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

Labels

backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CTAS: mistakenly allowed cross-db type references

3 participants