-
Notifications
You must be signed in to change notification settings - Fork 383
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
[Bug report] Drop schema with false
cascade goes unexpected
#1231
Comments
@Override
public String generateDropDatabaseSql(String databaseName, boolean cascade) {
if (cascade) {
throw new UnsupportedOperationException(
"MySQL does not support CASCADE option for DROP DATABASE.");
}
return "DROP DATABASE `" + databaseName + "`";
} I think we should change the logic here.
EntityStore obeys the logic above, or we can't guarantee consistency between |
Root cause: Dropping a database in MySQL with cascade false succeeds and fails in |
I will fix this issue |
jerryshao
pushed a commit
that referenced
this issue
Dec 25, 2023
### What changes were proposed in this pull request? - Allow dropping a database when `cascase` is `true`. - If the database is not empty and `cascade` is `false`, disable the drop operation. ### Why are the changes needed? Align the logic with Gravitino EntityStore. Fix: #1231 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? Add UT `testDropMySQLDatabase`
github-actions bot
pushed a commit
that referenced
this issue
Dec 25, 2023
### What changes were proposed in this pull request? - Allow dropping a database when `cascase` is `true`. - If the database is not empty and `cascade` is `false`, disable the drop operation. ### Why are the changes needed? Align the logic with Gravitino EntityStore. Fix: #1231 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? Add UT `testDropMySQLDatabase`
jerryshao
pushed a commit
that referenced
this issue
Dec 25, 2023
### What changes were proposed in this pull request? - Allow dropping a database when `cascase` is `true`. - If the database is not empty and `cascade` is `false`, disable the drop operation. ### Why are the changes needed? Align the logic with Gravitino EntityStore. Fix: #1231 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? Add UT `testDropMySQLDatabase` Co-authored-by: Qi Yu <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe what's wrong
Dropping a schema was unsuccessful, but it did indeed drop.
Error message and/or stacktrace
How to reproduce
Additional context
No response
The text was updated successfully, but these errors were encountered: