Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report error when cast bigint to datetime #12064

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/distributed/cases/dtype/datetime.result
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,16 @@ a
drop table t1;
SELECT CAST(20220101 AS datetime(0)) BETWEEN 20220101 AND -1;
CAST(20220101 AS datetime(0)) BETWEEN 20220101 AND -1
false
ERROR 20203 (HY000): invalid argument operator cast, bad value [BIGINT DATETIME]
SELECT CAST(00000501 AS datetime(0)) NOT BETWEEN 100 AND -1;
CAST(00000501 AS datetime(0)) NOT BETWEEN 100 AND -1
true
ERROR 20203 (HY000): invalid argument operator cast, bad value [BIGINT DATETIME]
SELECT CAST(0 AS datetime(0)) BETWEEN 0 AND -1;
CAST(0 AS datetime(0)) BETWEEN 0 AND -1
NULL
ERROR 20203 (HY000): invalid argument operator cast, bad value [BIGINT DATETIME]
SELECT CAST(1000101 as datetime(0)) BETWEEN '1000-01-01' and '1000-01-02';
CAST(1000101 as datetime(0)) BETWEEN '1000-01-01' and '1000-01-02'
false
ERROR 20203 (HY000): invalid argument operator cast, bad value [BIGINT DATETIME]
drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
Expand Down
2 changes: 0 additions & 2 deletions test/distributed/cases/dtype/datetime.test
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,10 @@ SELECT * FROM t1 WHERE coalesce(a)!=20220301;
SELECT * FROM t1 WHERE coalesce(a) in ('2022-03-01','2022-03-01 00:00:00.0001');
-- @bvt:issue
drop table t1;
-- @bvt:issue#3301
SELECT CAST(20220101 AS datetime(0)) BETWEEN 20220101 AND -1;
SELECT CAST(00000501 AS datetime(0)) NOT BETWEEN 100 AND -1;
SELECT CAST(0 AS datetime(0)) BETWEEN 0 AND -1;
SELECT CAST(1000101 as datetime(0)) BETWEEN '1000-01-01' and '1000-01-02';
-- @bvt:issue

#Test cases of update with single table
drop table if exists t1;
Expand Down