mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Added check of StorageView before checking parameterized view to fix seg fault when materialized view is used with brackets
This commit is contained in:
parent
b7ef782335
commit
3c7d749d2c
@ -1476,7 +1476,7 @@ StoragePtr Context::executeTableFunction(const ASTPtr & table_expression, const
|
||||
StoragePtr table = DatabaseCatalog::instance().tryGetTable({database_name, table_name}, getQueryContext());
|
||||
if (table)
|
||||
{
|
||||
if (table.get()->isView() && table->as<StorageView>()->isParameterizedView())
|
||||
if (table.get()->isView() && table->as<StorageView>() && table->as<StorageView>()->isParameterizedView())
|
||||
{
|
||||
function->prefer_subquery_to_function_formatting = true;
|
||||
return table;
|
||||
|
@ -40,3 +40,4 @@ ERROR
|
||||
10
|
||||
10
|
||||
1
|
||||
ERROR
|
||||
|
@ -112,7 +112,10 @@ $CLICKHOUSE_CLIENT -q "CREATE VIEW 02428_trace_view AS WITH {trace_id:String} A
|
||||
FROM 02428_otel_traces"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT * FROM 02428_trace_view(trace_id='1')"
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "CREATE MATERIALIZED VIEW test_02428_mv1 ENGINE = ReplicatedMergeTree('/clickhouse/tables/$CLICKHOUSE_TEST_ZOOKEEPER_PREFIX/materialized_view', 'r1') ORDER BY Name AS SELECT * FROM test_02428_Catalog;"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT * FROM test_02428_mv1(test)" 2>&1 | grep -Fq "UNKNOWN_FUNCTION" && echo 'ERROR' || echo 'OK'
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "DROP VIEW test_02428_mv1"
|
||||
$CLICKHOUSE_CLIENT -q "DROP VIEW test_02428_pv1"
|
||||
$CLICKHOUSE_CLIENT -q "DROP VIEW test_02428_pv2"
|
||||
$CLICKHOUSE_CLIENT -q "DROP VIEW test_02428_pv3"
|
||||
|
Loading…
Reference in New Issue
Block a user