mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #32508 from vdimir/issue_32458
Handle const column in JoinCommon::removeColumnNullability
This commit is contained in:
commit
17e5f5ccfe
@ -225,7 +225,13 @@ void removeColumnNullability(ColumnWithTypeAndName & column)
|
||||
|
||||
if (column.column && column.column->isNullable())
|
||||
{
|
||||
column.column = column.column->convertToFullColumnIfConst();
|
||||
const auto * nullable_col = checkAndGetColumn<ColumnNullable>(*column.column);
|
||||
if (!nullable_col)
|
||||
{
|
||||
throw DB::Exception(ErrorCodes::LOGICAL_ERROR, "Column '{}' is expected to be nullable", column.dumpStructure());
|
||||
}
|
||||
|
||||
MutableColumnPtr mutable_column = nullable_col->getNestedColumn().cloneEmpty();
|
||||
insertFromNullableOrDefault(mutable_column, nullable_col);
|
||||
column.column = std::move(mutable_column);
|
||||
|
13
tests/queries/0_stateless/02133_issue_32458.sql
Normal file
13
tests/queries/0_stateless/02133_issue_32458.sql
Normal file
@ -0,0 +1,13 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
|
||||
CREATE TABLE t1 (`id` Int32, `key` String) ENGINE = Memory;
|
||||
CREATE TABLE t2 (`id` Int32, `key` String) ENGINE = Memory;
|
||||
|
||||
INSERT INTO t1 VALUES (0, '');
|
||||
INSERT INTO t2 VALUES (0, '');
|
||||
|
||||
SELECT * FROM t1 ANY INNER JOIN t2 ON ((NULL = t1.key) = t2.id) AND (('' = t1.key) = t2.id);
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
Loading…
Reference in New Issue
Block a user