mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Merge pull request #69941 from ClickHouse/backport/24.8/69907
Backport #69907 to 24.8: Don't check dependencies during CREATE OR REPLACE VIEW during DROP of old table
This commit is contained in:
commit
7c7a657591
@ -1528,6 +1528,9 @@ bool InterpreterCreateQuery::doCreateTable(ASTCreateQuery & create,
|
||||
drop_ast->no_ddl_lock = true;
|
||||
|
||||
auto drop_context = Context::createCopy(context);
|
||||
/// Don't check dependencies during DROP of the view, because we will recreate
|
||||
/// it with the same name and all dependencies will remain valid.
|
||||
drop_context->setSetting("check_table_dependencies", false);
|
||||
InterpreterDropQuery interpreter(drop_ast, drop_context);
|
||||
interpreter.execute();
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
drop table if exists test;
|
||||
drop view if exists v;
|
||||
drop dictionary if exists dict;
|
||||
create table test (x UInt32, v String) engine=Memory;
|
||||
create view v (x UInt32, v String) as select x, v from test;
|
||||
CREATE DICTIONARY dict
|
||||
(
|
||||
x UInt64,
|
||||
v String
|
||||
)
|
||||
PRIMARY KEY x
|
||||
SOURCE(CLICKHOUSE(TABLE 'v'))
|
||||
LAYOUT(FLAT())
|
||||
LIFETIME(MIN 0 MAX 1000);
|
||||
|
||||
drop view v; -- {serverError HAVE_DEPENDENT_OBJECTS}
|
||||
create or replace view v (x UInt32, v String, y UInt32) as select x, v, 42 as y from test;
|
||||
drop dictionary dict;
|
||||
drop view v;
|
||||
drop table test;
|
||||
|
Loading…
Reference in New Issue
Block a user