-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add support for DROP SCHEMA CASCADE in JDBC connectors #18305
Conversation
TestPostgreSqlConnectorTest.testSelectInformationSchemaColumns failed though the test succeeded on the 2nd attempt. Going to remove support for PostgreSQL and Redshift from this PR.
The cause might be concurrent set column type tests.
https://github.com/trinodb/trino/actions/runs/5559234810/jobs/10156058413?pr=18305 |
7ec83fb
to
b2d1610
Compare
b2d1610
to
ff2400f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good.
throws SQLException | ||
{ | ||
// ClickHouse always deletes all tables inside the database https://clickhouse.com/docs/en/sql-reference/statements/drop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to prevent this if cascade
was not specified? (and in MySQL, MariaDB and Singlestore too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean throwing an exception when !cascade
? It means users always need to specify cascade option even when the target database is empty, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I was thinking of would require a list operation - and even then there can be races.
I don't know a good solution. My main concern is that if someone does a DROP SCHEMA
(without CASCADE
) they may not expect the operation to actually CASCADE
to all objects in the schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the test and manually tested without the same check in DropSchemaTask
.
6803a6d
to
64c57c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Squash fixups.
64c57c2
to
dfaced4
Compare
Description
Relates to #17649
Release notes
(x) Release notes are required, with the following suggested text: