summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2006-09-14 18:45:23 +0400
committerunknown <evgen@moonbone.local>2006-09-14 18:45:23 +0400
commitcca7be1c952680a72d6185d02955286824f546a7 (patch)
treeee2a27fa7b76a8aef7f5880e5c3a0cbc5698e82f /mysql-test
parentf3e838706d831b26fb9ca429bcfbc6a43f0fb533 (diff)
downloadmariadb-git-cca7be1c952680a72d6185d02955286824f546a7.tar.gz
type_date.test, type_date.result:
Added the test case for bug#21677: Wrong result when comparing a DATE and a DATETIME in BETWEEN mysql-test/t/type_date.test: Added the test case for bug#21677: Wrong result when comparing a DATE and a DATETIME in BETWEEN mysql-test/r/type_date.result: Added the test case for bug#21677: Wrong result when comparing a DATE and a DATETIME in BETWEEN
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/type_date.result6
-rw-r--r--mysql-test/t/type_date.test7
2 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index d8d6aa89684..99e9adf84ca 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -104,3 +104,9 @@ SELECT * FROM t1;
y
0000
DROP TABLE t1;
+create table t1(start_date date, end_date date);
+insert into t1 values ('2000-01-01','2000-01-02');
+select 1 from t1 where cast('2000-01-01 12:01:01' as datetime) between start_date and end_date;
+1
+1
+drop table t1;
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 5556d7f2831..c6050753943 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -115,4 +115,11 @@ INSERT INTO t1 VALUES ('abc');
SELECT * FROM t1;
DROP TABLE t1;
+#
+# Bug#21677: Wrong result when comparing a DATE and a DATETIME in BETWEEN
+#
+create table t1(start_date date, end_date date);
+insert into t1 values ('2000-01-01','2000-01-02');
+select 1 from t1 where cast('2000-01-01 12:01:01' as datetime) between start_date and end_date;
+drop table t1;
# End of 4.1 tests