Skip to content

Commit

Permalink
specify database name
Browse files Browse the repository at this point in the history
  • Loading branch information
xudong963 committed Nov 25, 2024
1 parent 9b5d9a1 commit 47c52bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/query/sql/src/planner/binder/bind_query/bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ use databend_common_ast::ast::CreateOption;
use databend_common_ast::ast::CreateTableStmt;
use databend_common_ast::ast::Engine;
use databend_common_ast::ast::Expr;
use databend_common_ast::ast::Identifier;
use databend_common_ast::ast::Query;
use databend_common_ast::ast::SetExpr;
use databend_common_ast::ast::TableType;
use databend_common_ast::ast::With;
use databend_common_ast::ast::CTE;
use databend_common_ast::Span;
use databend_common_exception::ErrorCode;
use databend_common_exception::Result;

Expand Down Expand Up @@ -181,11 +183,11 @@ impl Binder {
} else {
Engine::Memory
};

let database = self.ctx.get_current_database();
let create_table_stmt = CreateTableStmt {
create_option: CreateOption::CreateOrReplace,
catalog: None,
database: None,
database: Some(Identifier::from_name(Span::None, database)),
table: cte.alias.name.clone(),
source: None,
engine: Some(engine),
Expand Down

0 comments on commit 47c52bd

Please sign in to comment.