summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_time.test
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-09-28 10:41:09 +0500
committerunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-09-28 10:41:09 +0500
commit9c95543828d235776141da75be5c5d734dcfb6a3 (patch)
tree0206589b37fadb4693b5e585c4758c2e592ebfd6 /mysql-test/t/func_time.test
parent628846013ffc7744313b0c08763ed0862a0952aa (diff)
parentd6d786a07e422104a273a1bbb2c20a02cd76a2b6 (diff)
downloadmariadb-git-9c95543828d235776141da75be5c5d734dcfb6a3.tar.gz
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into mysql.com:/usr/home/ram/work/5.0-maint.b22227
Diffstat (limited to 'mysql-test/t/func_time.test')
-rw-r--r--mysql-test/t/func_time.test22
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..7303be31e03 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 cast('zzz' as date);
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;