diff options
author | gkodinov@dl145s.mysql.com <> | 2006-09-15 14:14:38 +0200 |
---|---|---|
committer | gkodinov@dl145s.mysql.com <> | 2006-09-15 14:14:38 +0200 |
commit | a9b3bd0eec68f5f3ad45eebfb0d18a2cc33da8b2 (patch) | |
tree | c06f430053b575c0cd47f1bd8c68cf1146aedef3 /mysql-test/t/func_time.test | |
parent | b1e087a717ccf618910d549f4621248dbbb94355 (diff) | |
parent | 325f820909aa5721719ab3eb25df636da72affe8 (diff) | |
download | mariadb-git-a9b3bd0eec68f5f3ad45eebfb0d18a2cc33da8b2.tar.gz |
Merge dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-opt
into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
Diffstat (limited to 'mysql-test/t/func_time.test')
-rw-r--r-- | mysql-test/t/func_time.test | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index be09b00ad46..fe34480d5d3 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -419,20 +419,20 @@ drop table t1; # # Bug#16377 result of DATE/TIME functions were compared as strings which # can lead to a wrong result. -# +# Now wrong dates should be compared only with CAST() create table t1(f1 date, f2 time, f3 datetime); insert into t1 values ("2006-01-01", "12:01:01", "2006-01-01 12:01:01"); insert into t1 values ("2006-01-02", "12:01:02", "2006-01-02 12:01:02"); -select f1 from t1 where f1 between "2006-1-1" and 20060101; -select f1 from t1 where f1 between "2006-1-1" and "2006.1.1"; -select f1 from t1 where date(f1) between "2006-1-1" and "2006.1.1"; -select f2 from t1 where f2 between "12:1:2" and "12:2:2"; -select f2 from t1 where time(f2) between "12:1:2" and "12:2:2"; -select f3 from t1 where f3 between "2006-1-1 12:1:1" and "2006-1-1 12:1:2"; -select f3 from t1 where timestamp(f3) between "2006-1-1 12:1:1" and "2006-1-1 12:1:2"; -select f1 from t1 where "2006-1-1" between f1 and f3; -select f1 from t1 where "2006-1-1" between date(f1) and date(f3); -select f1 from t1 where "2006-1-1" between f1 and 'zzz'; +select f1 from t1 where f1 between CAST("2006-1-1" as date) and CAST(20060101 as date); +select f1 from t1 where f1 between cast("2006-1-1" as date) and cast("2006.1.1" as date); +select f1 from t1 where date(f1) between cast("2006-1-1" as date) and cast("2006.1.1" as date); +select f2 from t1 where f2 between cast("12:1:2" as time) and cast("12:2:2" as time); +select f2 from t1 where time(f2) between cast("12:1:2" as time) and cast("12:2:2" as time); +select f3 from t1 where f3 between cast("2006-1-1 12:1:1" as datetime) and cast("2006-1-1 12:1:2" as datetime); +select f3 from t1 where timestamp(f3) between cast("2006-1-1 12:1:1" as datetime) and cast("2006-1-1 12:1:2" as datetime); +select f1 from t1 where cast("2006-1-1" as date) between f1 and f3; +select f1 from t1 where cast("2006-1-1" as date) between date(f1) and date(f3); +select f1 from t1 where cast("2006-1-1" as date) between f1 and 'zzz'; select f1 from t1 where makedate(2006,1) between date(f1) and date(f3); select f1 from t1 where makedate(2006,2) between date(f1) and date(f3); drop table t1; |