mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Fix empty tuple ALTER
This commit is contained in:
parent
49e41f23ee
commit
bf58f46808
@ -1033,6 +1033,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