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

Bug#51980 mysqld service crashes with a simple COUNT(DISTINCT) query over a view

Problem: Segmentation fault in add_group_and_distinct_keys() when accessing
field of what is assumed to be an Item_field object.

Cause: In case of views, the item added to list by is_indexed_agg_distinct() 
was not of type Item_field, but Item_ref.

Resolution:  Add the real Item_field object, the one referred to by 
Item_ref object, to the list, instead.
This commit is contained in:
oystein.grovlen@sun.com
2010-04-13 11:38:28 +02:00
parent 9b807ed57c
commit 5af5bb2da6
3 changed files with 20 additions and 1 deletions

View File

@ -4157,7 +4157,7 @@ is_indexed_agg_distinct(JOIN *join, List<Item_field> *out_args)
optimization is applicable
*/
if (out_args)
out_args->push_back((Item_field *) expr);
out_args->push_back((Item_field *) expr->real_item());
result= true;
}
}