mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Merge pull request #71878 from ClickHouse/backport/24.9/71679
Backport #71679 to 24.9: Fix LOGICAL_ERROR when doing ALTER with empty tuple
This commit is contained in:
commit
9a816c73dd
@ -1048,6 +1048,9 @@ private:
|
||||
size_t tuple_size,
|
||||
size_t input_rows_count) const
|
||||
{
|
||||
if (0 == tuple_size)
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Comparison of zero-sized tuples is not implemented");
|
||||
|
||||
ColumnsWithTypeAndName less_columns(tuple_size);
|
||||
ColumnsWithTypeAndName equal_columns(tuple_size - 1);
|
||||
ColumnsWithTypeAndName tmp_columns(2);
|
||||
|
@ -668,6 +668,9 @@ private:
|
||||
temporary_columns[0] = arguments[0];
|
||||
|
||||
size_t tuple_size = type1.getElements().size();
|
||||
if (tuple_size == 0)
|
||||
return ColumnTuple::create(input_rows_count);
|
||||
|
||||
Columns tuple_columns(tuple_size);
|
||||
|
||||
for (size_t i = 0; i < tuple_size; ++i)
|
||||
|
@ -0,0 +1 @@
|
||||
() 2
|
11
tests/queries/0_stateless/03268_empty_tuple_update.sql
Normal file
11
tests/queries/0_stateless/03268_empty_tuple_update.sql
Normal file
@ -0,0 +1,11 @@
|
||||
DROP TABLE IF EXISTS t0;
|
||||
|
||||
CREATE TABLE t0 (c0 Tuple(), c1 int) ENGINE = Memory();
|
||||
|
||||
INSERT INTO t0 VALUES ((), 1);
|
||||
|
||||
ALTER TABLE t0 UPDATE c0 = (), c1 = 2 WHERE EXISTS (SELECT 1);
|
||||
|
||||
SELECT * FROM t0;
|
||||
|
||||
DROP TABLE t0;
|
Loading…
Reference in New Issue
Block a user