• Tor Didriksen's avatar
    Bug#48060 Memory leak - Item::val_bool() (item.cc:184) from optimizer_subquery grammar · b2baeed4
    Tor Didriksen authored
    Item_sum::set_aggregator() may be called multiple times during query preparation.
    On subsequent calls: verify that the aggregator type is the same,
    and re-use the existing Aggregator.
    
    
    sql/item_sum.cc:
      In Item_sum::set_aggregator(): re-use existing Aggregator if already set.
      
      Remove some friend declarations, add some accessor functions.
      Cleanup some DBUG_ENTER and DBUG_RETURN code.
    sql/item_sum.h:
      Make some member fields private, add accessors instead.
      Remove some un-necessary friend declarations.
      Remove some default arguments from constructors.
    sql/opt_sum.cc:
      Use accessor functions in Item_sum.
    sql/sql_select.cc:
      Fix mis-spelled DBUG_ENTER text.
      Use accessor functions in Item_sum.
    sql/sql_yacc.yy:
      Use explicit true/false rather than default arguments when constructing
      Item_sum_xxx objects.
    b2baeed4
item_sum.cc 89.8 KB