mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added test with Date and numbers comparsion.
This commit is contained in:
parent
6bd61d17c9
commit
05ac77dbde
@ -1093,7 +1093,7 @@ public:
|
||||
const DataTypeTuple * right_tuple = checkAndGetDataType<DataTypeTuple>(arguments[1].get());
|
||||
|
||||
bool both_represented_by_number = arguments[0]->isValueRepresentedByNumber() && arguments[1]->isValueRepresentedByNumber();
|
||||
bool has_date = left.isDate() && right.isDate();
|
||||
bool has_date = left.isDate() || right.isDate();
|
||||
|
||||
if (!((both_represented_by_number && !has_date) /// Do not allow compare date and number.
|
||||
|| (left.isStringOrFixedString() && right.isStringOrFixedString())
|
||||
|
@ -0,0 +1,6 @@
|
||||
0
|
||||
1
|
||||
0
|
||||
0
|
||||
1
|
||||
0
|
13
dbms/tests/queries/0_stateless/00762_date_comparsion.sql
Normal file
13
dbms/tests/queries/0_stateless/00762_date_comparsion.sql
Normal file
@ -0,0 +1,13 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
select toDate('2018-01-01') < '2018-01-01';
|
||||
select toDate('2018-01-01') == '2018-01-01';
|
||||
select toDate('2018-01-01') != '2018-01-01';
|
||||
select toDate('2018-01-01') < toDate('2018-01-01');
|
||||
select toDate('2018-01-01') == toDate('2018-01-01');
|
||||
select toDate('2018-01-01') != toDate('2018-01-01');
|
||||
|
||||
select toDate('2018-01-01') < 1; -- { serverError 43 }
|
||||
select toDate('2018-01-01') == 1; -- { serverError 43 }
|
||||
select toDate('2018-01-01') != 1; -- { serverError 43 }
|
||||
|
Loading…
Reference in New Issue
Block a user