summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_like.result9
-rw-r--r--mysql-test/r/type_year.result6
-rw-r--r--mysql-test/t/func_like.test10
-rw-r--r--mysql-test/t/type_year.test9
4 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result
index f923c16b2ac..b196b50f53b 100644
--- a/mysql-test/r/func_like.result
+++ b/mysql-test/r/func_like.result
@@ -37,3 +37,12 @@ select * from t1 where a like "%abc\d%";
a
abcd
drop table t1;
+create table t1 (a varchar(10), key(a));
+insert into t1 values ('a'), ('a\\b');
+select * from t1 where a like 'a\\%' escape '#';
+a
+a\b
+select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
+a
+a\b
+drop table t1;
diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result
index 25ddda88f48..5ef3c1bba81 100644
--- a/mysql-test/r/type_year.result
+++ b/mysql-test/r/type_year.result
@@ -26,3 +26,9 @@ y y2
2001 01
2069 69
drop table t1;
+create table t1 (y year);
+insert into t1 values (now());
+select if(y = now(), 1, 0) from t1;
+if(y = now(), 1, 0)
+1
+drop table t1;
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test
index a5d1193fd74..6d6ee8f86a3 100644
--- a/mysql-test/t/func_like.test
+++ b/mysql-test/t/func_like.test
@@ -21,3 +21,13 @@ select * from t1 where a like "%abcd%";
select * from t1 where a like "%abc\d%";
drop table t1;
+
+#
+# Bug #2231
+#
+
+create table t1 (a varchar(10), key(a));
+insert into t1 values ('a'), ('a\\b');
+select * from t1 where a like 'a\\%' escape '#';
+select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
+drop table t1;
diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test
index 8f4f23badb4..e9e34dbc29f 100644
--- a/mysql-test/t/type_year.test
+++ b/mysql-test/t/type_year.test
@@ -8,3 +8,12 @@ select * from t1;
select * from t1 order by y;
select * from t1 order by y2;
drop table t1;
+
+#
+# Bug 2335
+#
+
+create table t1 (y year);
+insert into t1 values (now());
+select if(y = now(), 1, 0) from t1;
+drop table t1;