Commit 3fe9de28 authored by igor@olga.mysql.com's avatar igor@olga.mysql.com

Merge olga.mysql.com:/home/igor/mysql-5.0-opt

into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26017
parents 380c2205 951fe3ca
...@@ -1194,3 +1194,23 @@ a b ...@@ -1194,3 +1194,23 @@ a b
3 3 3 3
4 NULL 4 NULL
DROP TABLE t1,t2; 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;
...@@ -802,3 +802,26 @@ SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 2=2); ...@@ -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); SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 1=0);
DROP TABLE t1,t2; 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;
...@@ -4034,11 +4034,9 @@ longlong Item_equal::val_int() ...@@ -4034,11 +4034,9 @@ longlong Item_equal::val_int()
void Item_equal::fix_length_and_dec() 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(), eval_item= cmp_item::get_comparator(item->result_type(),
item->collation.collation); 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) bool Item_equal::walk(Item_processor processor, byte *arg)
......
...@@ -1296,7 +1296,6 @@ class Item_equal: public Item_bool_func ...@@ -1296,7 +1296,6 @@ class Item_equal: public Item_bool_func
Item *const_item; /* optional constant item equal to fields items */ Item *const_item; /* optional constant item equal to fields items */
cmp_item *eval_item; cmp_item *eval_item;
bool cond_false; bool cond_false;
DTCollation cmp_collation;
public: public:
inline Item_equal() inline Item_equal()
: Item_bool_func(), const_item(0), eval_item(0), cond_false(0) : Item_bool_func(), const_item(0), eval_item(0), cond_false(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment