• unknown's avatar
    Bug #23184: SELECT causes server crash · 634d3991
    unknown authored
     Item::val_xxx() may be called by the server several times at execute time 
     for a single query. Calls to val_xxx() may be very expensive and sometimes
     (count(distinct), sum(distinct), avg(distinct)) not possible.
     To avoid that problem the results of calculation for these aggregate 
     functions are cached so that val_xxx() methods just return the calculated 
     value for the second and subsequent calls.
    
    
    mysql-test/r/func_group.result:
      Bug #23184: SELECT causes server crash
       - test case
    mysql-test/t/func_group.test:
      Bug #23184: SELECT causes server crash
       - test case
    sql/item_sum.cc:
      Bug #23184: SELECT causes server crash
       - caching of the aggregate function results so no need to recalculate at val_xxx()
    sql/item_sum.h:
      Bug #23184: SELECT causes server crash
       - caching of the aggregate function results so no need to recalculate at val_xxx()
    634d3991
item_sum.cc 84.4 KB