Commit d2a69d8f authored by unknown's avatar unknown

Merge rurik.mysql.com:/home/igor/mysql-4.1

into rurik.mysql.com:/home/igor/dev/mysql-4.1-0

parents 000255ee 7f905da3
...@@ -2400,3 +2400,25 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -2400,3 +2400,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 1 SIMPLE t1 ALL NULL NULL NULL NULL 5
1 SIMPLE t2 ref a a 23 test.t1.a 2 1 SIMPLE t2 ref a a 23 test.t1.a 2
DROP TABLE t1, t2; DROP TABLE t1, t2;
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
INSERT INTO t1 VALUES ('Paris');
SELECT * FROM t1 WHERE city='London';
city
London
SELECT * FROM t1 WHERE city='london';
city
London
EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM t1 WHERE city='London' AND city='london';
city
London
EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
city
London
DROP TABLE t1;
...@@ -1945,3 +1945,22 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; ...@@ -1945,3 +1945,22 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
DROP TABLE t1, t2; DROP TABLE t1, t2;
#
# Test case for bug 7098: substitution of a constant for a string field
#
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
INSERT INTO t1 VALUES ('Paris');
SELECT * FROM t1 WHERE city='London';
SELECT * FROM t1 WHERE city='london';
EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london';
SELECT * FROM t1 WHERE city='London' AND city='london';
EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
DROP TABLE t1;
...@@ -4230,6 +4230,8 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list, ...@@ -4230,6 +4230,8 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
Item *tmp=value->new_item(); Item *tmp=value->new_item();
if (tmp) if (tmp)
{ {
tmp->collation.set(value->collation.collation,
value->collation.derivation);
thd->change_item_tree(args + 1, tmp); thd->change_item_tree(args + 1, tmp);
func->update_used_tables(); func->update_used_tables();
if ((functype == Item_func::EQ_FUNC || functype == Item_func::EQUAL_FUNC) if ((functype == Item_func::EQ_FUNC || functype == Item_func::EQUAL_FUNC)
...@@ -4251,6 +4253,8 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list, ...@@ -4251,6 +4253,8 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
Item *tmp=value->new_item(); Item *tmp=value->new_item();
if (tmp) if (tmp)
{ {
tmp->collation.set(value->collation.collation,
value->collation.derivation);
thd->change_item_tree(args, tmp); thd->change_item_tree(args, tmp);
value= tmp; value= tmp;
func->update_used_tables(); func->update_used_tables();
......
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