mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #29323 from ClickHouse/fix_assertion_ddl_dependency
Fix assertion in DDLDependencyVisitor
This commit is contained in:
commit
e9749b0027
@ -18,9 +18,18 @@ void DDLDependencyVisitor::visit(const ASTPtr & ast, Data & data)
|
||||
visit(*dict_source, data);
|
||||
}
|
||||
|
||||
bool DDLDependencyVisitor::needChildVisit(const ASTPtr & node, const ASTPtr & /*child*/)
|
||||
bool DDLDependencyVisitor::needChildVisit(const ASTPtr & node, const ASTPtr & child)
|
||||
{
|
||||
return !node->as<ASTStorage>();
|
||||
if (node->as<ASTStorage>())
|
||||
return false;
|
||||
|
||||
if (auto * create = node->as<ASTCreateQuery>())
|
||||
{
|
||||
if (child.get() == create->select)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DDLDependencyVisitor::visit(const ASTFunction & function, Data & data)
|
||||
|
@ -2,5 +2,6 @@ dict1
|
||||
dict2
|
||||
dict_src
|
||||
join
|
||||
mv
|
||||
s
|
||||
t
|
||||
|
@ -30,6 +30,8 @@ $CLICKHOUSE_CLIENT -q "create table s (x default joinGet($CLICKHOUSE_DATABASE.jo
|
||||
$CLICKHOUSE_CLIENT -q "create table t (n int, m int default joinGet($CLICKHOUSE_DATABASE.join, 'm', 42::int),
|
||||
s String default dictGet($CLICKHOUSE_DATABASE.dict1, 's', 42::UInt64), x default in(1, $CLICKHOUSE_DATABASE.s)) engine=MergeTree order by n;"
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "create materialized view mv to s as select n from t where n in (select n from join)"
|
||||
|
||||
CLICKHOUSE_CLIENT_DEFAULT_DB=$(echo ${CLICKHOUSE_CLIENT} | sed 's/'"--database=${CLICKHOUSE_DATABASE}"'/--database=default/g')
|
||||
|
||||
for _ in {1..10}; do
|
||||
|
Loading…
Reference in New Issue
Block a user