mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Merge pull request #45952 from ucasfl/tuple
Fix tupleElement with Null arguments
This commit is contained in:
commit
061204408a
@ -56,10 +56,9 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override
|
||||
{
|
||||
return {1};
|
||||
}
|
||||
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1}; }
|
||||
|
||||
bool useDefaultImplementationForNulls() const override { return false; }
|
||||
|
||||
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return false; }
|
||||
|
||||
|
@ -58,7 +58,7 @@ select min(dt), max(dt), count(toDate(dt) >= '2021-10-25') from d where toDate(d
|
||||
select count() from d group by toDate(dt);
|
||||
|
||||
-- fuzz crash
|
||||
SELECT min(dt), count(ignore(ignore(ignore(tupleElement(_partition_value, NULL) = NULL), NULL, NULL, NULL), 0, '10485.76', NULL)), max(dt), count(toDate(dt) >= '2021-10-25') FROM d WHERE toDate(dt) >= '2021-10-25';
|
||||
SELECT min(dt), count(ignore(ignore(ignore(tupleElement(_partition_value, 'xxxx', NULL) = NULL), NULL, NULL, NULL), 0, '10485.76', NULL)), max(dt), count(toDate(dt) >= '2021-10-25') FROM d WHERE toDate(dt) >= '2021-10-25';
|
||||
|
||||
-- fuzz crash
|
||||
SELECT pointInEllipses(min(j), NULL), max(dt), count('0.0000000007') FROM d WHERE toDate(dt) >= '2021-10-25';
|
||||
|
@ -0,0 +1,2 @@
|
||||
1 1 2 2
|
||||
\N \N 3 3
|
19
tests/queries/0_stateless/02541_tuple_element_with_null.sql
Normal file
19
tests/queries/0_stateless/02541_tuple_element_with_null.sql
Normal file
@ -0,0 +1,19 @@
|
||||
DROP TABLE IF EXISTS test_tuple_element;
|
||||
CREATE TABLE test_tuple_element
|
||||
(
|
||||
tuple Tuple(k1 Nullable(UInt64), k2 UInt64)
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY tuple()
|
||||
SETTINGS index_granularity = 8192;
|
||||
|
||||
INSERT INTO test_tuple_element VALUES (tuple(1,2)), (tuple(NULL, 3));
|
||||
|
||||
SELECT
|
||||
tupleElement(tuple, 'k1', 0) fine_k1_with_0,
|
||||
tupleElement(tuple, 'k1', NULL) k1_with_null,
|
||||
tupleElement(tuple, 'k2', 0) k2_with_0,
|
||||
tupleElement(tuple, 'k2', NULL) k2_with_null
|
||||
FROM test_tuple_element;
|
||||
|
||||
DROP TABLE test_tuple_element;
|
Loading…
Reference in New Issue
Block a user