Skip to content
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

chore(query): Rename table not allow modify catalog or database #14098

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Dec 20, 2023

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Rename table not allow modify catalog or database

It's no use to support this, It will cause other questions.

rename table db1.t1 to db2.t2

BTW alter table can also rename table, it also not support modify database.

Fixes #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Dec 20, 2023
@TCeason
Copy link
Collaborator Author

TCeason commented Dec 20, 2023

cc @wubx after this pr merge into main branch, Databend not support modify databend while execute sql rename table.

@BohuTANG BohuTANG merged commit a4e5868 into databendlabs:main Dec 20, 2023
68 checks passed
Comment on lines +1001 to 1004
if new_catalog != catalog || new_database != database {
return Err(ErrorCode::BadArguments(
"alter catalog not allowed while rename table",
"Rename table not allow modify catalog or database",
));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if new_catalog != catalog || new_database != database {
return Err(ErrorCode::BadArguments(
"alter catalog not allowed while rename table",
"Rename table not allow modify catalog or database",
));
if new_catalog != catalog || new_database != database {
return Err(ErrorCode::BadArguments(
"Rename table not allow modify catalog or database",
))
.set_span(database.and_then(|ident| ident.span));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-chore this PR only has small changes that no need to record, like coding styles.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants