mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 18:42:26 +00:00
Merge pull request #70623 from ClickHouse/backport/24.8/70264
Backport #70264 to 24.8: Fix segfault on creating materialized view with intersect
This commit is contained in:
commit
4bdf94f150
@ -100,17 +100,20 @@ void checkAllowedQueries(const ASTSelectQuery & query)
|
|||||||
/// check if only one single select query in SelectWithUnionQuery
|
/// check if only one single select query in SelectWithUnionQuery
|
||||||
static bool isSingleSelect(const ASTPtr & select, ASTPtr & res)
|
static bool isSingleSelect(const ASTPtr & select, ASTPtr & res)
|
||||||
{
|
{
|
||||||
auto new_select = select->as<ASTSelectWithUnionQuery &>();
|
auto * new_select = select->as<ASTSelectWithUnionQuery>();
|
||||||
if (new_select.list_of_selects->children.size() != 1)
|
if (new_select == nullptr)
|
||||||
return false;
|
return false;
|
||||||
auto & new_inner_query = new_select.list_of_selects->children.at(0);
|
|
||||||
|
if (new_select->list_of_selects->children.size() != 1)
|
||||||
|
return false;
|
||||||
|
auto & new_inner_query = new_select->list_of_selects->children.at(0);
|
||||||
if (new_inner_query->as<ASTSelectQuery>())
|
if (new_inner_query->as<ASTSelectQuery>())
|
||||||
{
|
{
|
||||||
res = new_inner_query;
|
res = new_inner_query;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return isSingleSelect(new_inner_query, res);
|
return isSingleSelect(new_inner_query, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectQueryDescription SelectQueryDescription::getSelectQueryFromASTForMatView(const ASTPtr & select, bool refreshable, ContextPtr context)
|
SelectQueryDescription SelectQueryDescription::getSelectQueryFromASTForMatView(const ASTPtr & select, bool refreshable, ContextPtr context)
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
CREATE MATERIALIZED VIEW v0 AS (SELECT 1) INTERSECT (SELECT 1); --{serverError QUERY_IS_NOT_SUPPORTED_IN_MATERIALIZED_VIEW}
|
Loading…
Reference in New Issue
Block a user