Merge pull request #42573 from ClickHouse/remove-trash-6

Remove trash
This commit is contained in:
Alexey Milovidov 2022-10-23 01:31:10 +02:00 committed by GitHub
commit ebf330ca1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 2 deletions

View File

@ -899,10 +899,10 @@ class FunctionBinaryArithmetic : public IFunction
std::swap(new_arguments[0], new_arguments[1]);
/// Change interval argument type to its representation
new_arguments[1].type = std::make_shared<DataTypeNumber<DataTypeInterval::FieldType>>();
if (WhichDataType(new_arguments[1].type).isInterval())
new_arguments[1].type = std::make_shared<DataTypeNumber<DataTypeInterval::FieldType>>();
auto function = function_builder->build(new_arguments);
return function->execute(new_arguments, result_type, input_rows_count);
}

View File

@ -0,0 +1,8 @@
1
1
1
1
1
1
1
1

View File

@ -0,0 +1,19 @@
SELECT now() + 1::Int128; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
SELECT now() + 1::Int256; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
SELECT now() + 1::UInt128; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
SELECT now() + 1::UInt256; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
SELECT now() - 1::Int128; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
SELECT now() - 1::Int256; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
SELECT now() - 1::UInt128; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
SELECT now() - 1::UInt256; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
SELECT now() + INTERVAL 1::Int128 SECOND - now();
SELECT now() + INTERVAL 1::Int256 SECOND - now();
SELECT now() + INTERVAL 1::UInt128 SECOND - now();
SELECT now() + INTERVAL 1::UInt256 SECOND - now();
SELECT today() + INTERVAL 1::Int128 DAY - today();
SELECT today() + INTERVAL 1::Int256 DAY - today();
SELECT today() + INTERVAL 1::UInt128 DAY - today();
SELECT today() + INTERVAL 1::UInt256 DAY - today();

View File

@ -0,0 +1,6 @@
DROP TABLE IF EXISTS alias_2__fuzz_25;
SET allow_suspicious_low_cardinality_types = 1;
CREATE TABLE alias_2__fuzz_25 (`dt` LowCardinality(Date), `col` DateTime, `col2` Nullable(Int256), `colAlias0` Nullable(DateTime64(3)) ALIAS col, `colAlias3` Nullable(Int32) ALIAS col3 + colAlias0, `colAlias1` LowCardinality(UInt16) ALIAS colAlias0 + col2, `colAlias2` LowCardinality(Int32) ALIAS colAlias0 + colAlias1, `col3` Nullable(UInt8)) ENGINE = MergeTree ORDER BY dt;
insert into alias_2__fuzz_25 (dt, col, col2, col3) values ('2020-02-01', 1, 2, 3);
SELECT colAlias0, colAlias2, colAlias3 FROM alias_2__fuzz_25; -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
DROP TABLE alias_2__fuzz_25;