• igor@olga.mysql.com's avatar
    Fixed bug #24856: the result set of a ROLLUP query with DISTINCT could lack · ce0be732
    igor@olga.mysql.com authored
    some rollup rows (rows with NULLs for grouping attributes) if GROUP BY
    list contained constant expressions.
    
    This happened because the results of constant expressions were not put
    in the temporary table used for duplicate elimination. In fact a constant
    item from the GROUP BY list of a ROLLUP query can be replaced for an
    Item_null_result object when a rollup row is produced . 
    
    Now the JOIN::rollup_init function wraps any constant item referenced in
    the GROYP BY list of a ROLLUP query into an Item_func object of a special
    class that is never detected as constant item. This ensures creation of
    fields for such  constant items in temporary tables and guarantees right
    results when the result of the rollup operation first has to be written
    into a temporary table, e.g. in the cases when duplicate elimination is
    required.  
    ce0be732
sql_select.cc 300 KB