1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug #43354: Use key hint can crash server in explain extended query

The copy of the original arguments of a aggregate function was not
initialized until after fix_fields().
Sometimes (e.g. when there's an error processing the statement)
the print() can be called with no corresponding fix_fields() call.
      
Fixed by adding a check if the Item is fixed before using the arguments
copy.
This commit is contained in:
Georgi Kodinov
2009-03-11 14:10:44 +02:00
parent 62adf8953a
commit e546077ee8
3 changed files with 19 additions and 1 deletions

View File

@@ -155,3 +155,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
DROP TABLE t1,t2;
CREATE TABLE t1 (a INT PRIMARY KEY);
EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a);
ERROR HY000: Key 'a' doesn't exist in table 't1'
DROP TABLE t1;