1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
from mysql-next-mr-opt-backporting.

Bug#54515: Crash in opt_range.cc::get_best_group_min_max on 
           SELECT from VIEW with GROUP BY
      
When handling the grouping items in get_best_group_min_max, the
items need to be of type Item_field. In this bug, an ASSERT 
triggered because the item used for grouping was an 
Item_direct_view_ref (i.e., the group column is from a view). 
The fix is to get the real_item since Item_ref* pointing to 
Item_field is ok.
This commit is contained in:
Olav Sandstaa
2010-07-08 15:19:05 +02:00
parent 65bdafda29
commit b7166f33d0
3 changed files with 44 additions and 2 deletions

View File

@ -4857,3 +4857,22 @@ SELECT * FROM t1 WHERE 102 < c;
a b c
DROP TABLE t1;
End of 5.1 tests
#
# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on
# SELECT from VIEW with GROUP BY
#
CREATE TABLE t1 (
col_int_key int DEFAULT NULL,
KEY int_key (col_int_key)
) ;
INSERT INTO t1 VALUES (1),(2);
CREATE VIEW view_t1 AS
SELECT t1.col_int_key AS col_int_key
FROM t1;
SELECT col_int_key FROM view_t1 GROUP BY col_int_key;
col_int_key
1
2
DROP VIEW view_t1;
DROP TABLE t1;
# End of test BUG#54515