diff options
author | unknown <gkodinov/kgeorge@macbook.gmz> | 2006-10-16 18:09:58 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@macbook.gmz> | 2006-10-16 18:09:58 +0300 |
commit | ffc1facce894359d5339ca7513a5518c2d829f29 (patch) | |
tree | ddf7474cc07baef2f6c1c4ff063b7613f711b03b /mysql-test/r/func_str.result | |
parent | 78bf02870c9a277ae785ab5705b4a5c0556b149e (diff) | |
download | mariadb-git-ffc1facce894359d5339ca7513a5518c2d829f29.tar.gz |
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
MySQL is setting the flag HA_END_SPACE_KEYS for all the keys that reference
text or varchar columns with collation different than binary.
This was done to handle correctly the situation where a lookup on such a key
may return more than 1 row because of the presence of many rows that differ
only by the amount of trailing space in the table's string column.
Inserting such values however appears to violate the unique checks on
INSERT/UPDATE. Thus that flag must not be set as it will prevent the optimizer
from choosing a faster access method.
This fix removes the setting of the HA_END_SPACE_KEYS flag.
include/my_base.h:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- disabled HA_END_SPACE_KEY as it's no longer needed
mysql-test/r/func_str.result:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- fixed explain in an existing case
mysql-test/r/merge.result:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- fixed explain in an existing case
mysql-test/r/select.result:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- test case
mysql-test/r/subselect.result:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- fixed explain in an existing case
mysql-test/t/select.test:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- test case
Diffstat (limited to 'mysql-test/r/func_str.result')
-rw-r--r-- | mysql-test/r/func_str.result | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 00642e1a570..c2c12f8d291 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1143,9 +1143,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON code=id WHERE id='a12' AND (LENGTH(code)=5 OR code < 'a00'); id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const PRIMARY PRIMARY 12 const 1 Using index 1 SIMPLE t1 ref code code 13 const 3 Using where; Using index -1 SIMPLE t2 ref PRIMARY PRIMARY 12 const 1 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`code` AS `code`,`test`.`t2`.`id` AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = _latin1'a12') and (`test`.`t2`.`id` = _latin1'a12') and (length(`test`.`t1`.`code`) = 5)) +Note 1003 select `test`.`t1`.`code` AS `code`,`test`.`t2`.`id` AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = _latin1'a12') and (length(`test`.`t1`.`code`) = 5)) DROP TABLE t1,t2; End of 5.0 tests |