Below is the list of changes that have just been committed into a local
5.0 repository of igor. When igor does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-02-09 12:54:50-08:00, igor@stripped +4 -0
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@stripped, 2007-02-09 12:54:48-08:00, igor@stripped +20
-0
Added a test case for bug #26017.
mysql-test/t/join_outer.test@stripped, 2007-02-09 12:54:48-08:00, igor@stripped +23 -0
Added a test case for bug #26017.
sql/item_cmpfunc.cc@stripped, 2007-02-09 12:54:48-08:00, igor@stripped +1 -3
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@stripped, 2007-02-09 12:54:48-08:00, igor@stripped +0 -1
Fixed bug #26017.
Removed the cmp_collation member from the Item_equal class as useless
for the current implementation of the class.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: igor
# Host: olga.mysql.com
# Root: /home/igor/dev-opt/mysql-5.0-opt-bug26017
--- 1.232/sql/item_cmpfunc.cc 2007-02-09 12:54:56 -08:00
+++ 1.233/sql/item_cmpfunc.cc 2007-02-09 12:54:56 -08:00
@@ -4034,11 +4034,9 @@
void Item_equal::fix_length_and_dec()
{
- Item *item= const_item ? const_item : get_first();
+ Item *item= get_first();
eval_item= cmp_item::get_comparator(item->result_type(),
item->collation.collation);
- if (item->result_type() == STRING_RESULT)
- eval_item->cmp_charset= cmp_collation.collation;
}
bool Item_equal::walk(Item_processor processor, byte *arg)
--- 1.139/sql/item_cmpfunc.h 2007-02-09 12:54:56 -08:00
+++ 1.140/sql/item_cmpfunc.h 2007-02-09 12:54:56 -08:00
@@ -1296,7 +1296,6 @@
Item *const_item; /* optional constant item equal to fields items */
cmp_item *eval_item;
bool cond_false;
- DTCollation cmp_collation;
public:
inline Item_equal()
: Item_bool_func(), const_item(0), eval_item(0), cond_false(0)
--- 1.52/mysql-test/r/join_outer.result 2007-02-09 12:54:56 -08:00
+++ 1.53/mysql-test/r/join_outer.result 2007-02-09 12:54:56 -08:00
@@ -1194,3 +1194,23 @@
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;
--- 1.38/mysql-test/t/join_outer.test 2007-02-09 12:54:56 -08:00
+++ 1.39/mysql-test/t/join_outer.test 2007-02-09 12:54:56 -08:00
@@ -802,3 +802,26 @@
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;
| Thread |
|---|
| • bk commit into 5.0 tree (igor:1.2406) BUG#26017 | igor | 9 Feb |