mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Merge pull request #60765 from Avogar/fix-crash-in-input-join
Fix crash when using input() in INSERT SELECT JOIN
This commit is contained in:
commit
8aeffa0356
@ -1816,7 +1816,7 @@ StoragePtr Context::executeTableFunction(const ASTPtr & table_expression, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t use_structure_from_insertion_table_in_table_functions = getSettingsRef().use_structure_from_insertion_table_in_table_functions;
|
uint64_t use_structure_from_insertion_table_in_table_functions = getSettingsRef().use_structure_from_insertion_table_in_table_functions;
|
||||||
if (use_structure_from_insertion_table_in_table_functions && table_function_ptr->needStructureHint() && hasInsertionTable())
|
if (select_query_hint && use_structure_from_insertion_table_in_table_functions && table_function_ptr->needStructureHint() && hasInsertionTable())
|
||||||
{
|
{
|
||||||
const auto & insert_columns = DatabaseCatalog::instance()
|
const auto & insert_columns = DatabaseCatalog::instance()
|
||||||
.getTable(getInsertionTable(), shared_from_this())
|
.getTable(getInsertionTable(), shared_from_this())
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
2
|
14
tests/queries/0_stateless/03005_input_function_in_join.sql
Normal file
14
tests/queries/0_stateless/03005_input_function_in_join.sql
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
drop table if exists test;
|
||||||
|
create table test (a Int8) engine = MergeTree order by tuple();
|
||||||
|
INSERT INTO test
|
||||||
|
SELECT x.number FROM (
|
||||||
|
SELECT number
|
||||||
|
FROM system.numbers
|
||||||
|
LIMIT 10
|
||||||
|
) AS x
|
||||||
|
INNER JOIN input('a UInt64') AS y ON x.number = y.a
|
||||||
|
Format CSV 2
|
||||||
|
;
|
||||||
|
select * from test;
|
||||||
|
drop table test;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user