Skip to content

Commit

Permalink
fix: check_permission for Create Table ... Like
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Feb 23, 2024
1 parent 1ec4159 commit d896e34
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/frontend/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,8 @@ pub fn check_permission(
// database ops won't be checked
Statement::CreateDatabase(_) | Statement::ShowDatabases(_) => {}
// show create table and alter are not supported yet
Statement::ShowCreateTable(_)
| Statement::CreateExternalTable(_)
| Statement::CreateTableLike(_)
| Statement::Alter(_) => {}
Statement::ShowCreateTable(_) | Statement::CreateExternalTable(_) | Statement::Alter(_) => {
}
// set/show variable now only alter/show variable in session
Statement::SetVariables(_) | Statement::ShowVariables(_) => {}

Expand All @@ -473,6 +471,10 @@ pub fn check_permission(
Statement::CreateTable(stmt) => {
validate_param(&stmt.name, query_ctx)?;
}
Statement::CreateTableLike(stmt) => {
validate_param(&stmt.name, query_ctx)?;
validate_param(&stmt.target, query_ctx)?;
}
Statement::DropTable(drop_stmt) => {
validate_param(drop_stmt.table_name(), query_ctx)?;
}
Expand Down

0 comments on commit d896e34

Please sign in to comment.