summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-02-09 12:54:50 -0800
committerunknown <igor@olga.mysql.com>2007-02-09 12:54:50 -0800
commit7ab33d50702dce3d8666a6c7db13530e069abdc0 (patch)
tree85afdb1732e9027f0bba3c01c67e9da73a9e743e /mysql-test
parent3609c3a4a3aaa42525d22d9de4f92c0ca7ffeeac (diff)
downloadmariadb-git-7ab33d50702dce3d8666a6c7db13530e069abdc0.tar.gz
Fixed bug #26017.
Objects of the class Item_equal contain an auxiliary member eval_item of the type cmp_item that is used only for direct evaluation of multiple equalities. Currently a multiple equality is evaluated directly only in the cases when the equality holds at most for one row in the result set. The compare collation of eval_item was determined incorectly. It could lead to returning incorrect results for some queries. mysql-test/r/join_outer.result: Added a test case for bug #26017. mysql-test/t/join_outer.test: Added a test case for bug #26017. sql/item_cmpfunc.cc: Fixed bug #26017. Objects of the class Item_equal contain an auxiliary member eval_item of the type cmp_item that is used only for direct evaluation of multiple equalities. Currently a multiple equality is evaluated directly only in the cases when the equality holds at most for one row in the result set. The compare collation of eval_item was determined incorrectly. It could lead to returning incorrect results for some queries. sql/item_cmpfunc.h: Fixed bug #26017. Removed the cmp_collation member from the Item_equal class as useless for the current implementation of the class.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/join_outer.result20
-rw-r--r--mysql-test/t/join_outer.test23
2 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 89bb26c4b3f..df66336bd81 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1194,3 +1194,23 @@ a b
3 3
4 NULL
DROP TABLE t1,t2;
+CREATE TABLE t1 (
+f1 varchar(16) collate latin1_swedish_ci PRIMARY KEY,
+f2 varchar(16) collate latin1_swedish_ci
+);
+CREATE TABLE t2 (
+f1 varchar(16) collate latin1_swedish_ci PRIMARY KEY,
+f3 varchar(16) collate latin1_swedish_ci
+);
+INSERT INTO t1 VALUES ('bla','blah');
+INSERT INTO t2 VALUES ('bla','sheep');
+SELECT * FROM t1 JOIN t2 USING(f1) WHERE f1='Bla';
+f1 f2 f3
+bla blah sheep
+SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='bla';
+f1 f2 f3
+bla blah sheep
+SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='Bla';
+f1 f2 f3
+bla blah sheep
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 20462f2ca3f..a0620e144c2 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -802,3 +802,26 @@ SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 2=2);
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 1=0);
DROP TABLE t1,t2;
+
+#
+# Bug 26017: LEFT OUTER JOIN over two constant tables and
+# a case-insensitive comparison predicate field=const
+#
+
+CREATE TABLE t1 (
+ f1 varchar(16) collate latin1_swedish_ci PRIMARY KEY,
+ f2 varchar(16) collate latin1_swedish_ci
+);
+CREATE TABLE t2 (
+ f1 varchar(16) collate latin1_swedish_ci PRIMARY KEY,
+ f3 varchar(16) collate latin1_swedish_ci
+);
+
+INSERT INTO t1 VALUES ('bla','blah');
+INSERT INTO t2 VALUES ('bla','sheep');
+
+SELECT * FROM t1 JOIN t2 USING(f1) WHERE f1='Bla';
+SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='bla';
+SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='Bla';
+
+DROP TABLE t1,t2;