1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized

away.

Additional fix for bug#22331. Now Item_field prints its value in the case of
the const field.
This commit is contained in:
evgen@moonbone.local
2007-03-10 00:29:02 +03:00
parent 999c1cdcc1
commit 04f5c46d5d
12 changed files with 49 additions and 25 deletions

View File

@ -1089,12 +1089,12 @@ explain extended select encode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
Warnings:
Note 1003 select encode(`test`.`t1`.`f1`,'zxcv') AS `enc` from `test`.`t1`
Note 1003 select encode('','zxcv') AS `enc` from `test`.`t1`
explain extended select decode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
Warnings:
Note 1003 select decode(`test`.`t1`.`f1`,'zxcv') AS `enc` from `test`.`t1`
Note 1003 select decode('','zxcv') AS `enc` from `test`.`t1`
drop table t1;
End of 4.1 tests
create table t1 (d decimal default null);
@ -1158,7 +1158,7 @@ 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
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 (length(`test`.`t1`.`code`) = 5))
Note 1003 select `test`.`t1`.`code` AS `code`,'a12' AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = _latin1'a12') and (length(`test`.`t1`.`code`) = 5))
DROP TABLE t1,t2;
select locate('he','hello',-2);
locate('he','hello',-2)