• unknown's avatar
    Implementation of SUM(DISTINCT), tests cases · 58a52a2a
    unknown authored
    
    sql/filesort.cc:
      Snippet of filesort() code moved to function reuse_freed_buff() - 
      change buffpek pointers to use buff from freed BUFFPEK
      Used in filesort() and merge_walk().
    sql/item_sum.cc:
      Implementation of Item_sum_sum_distinct - SUM(DISTINCT) item, 
      which uses Unique to resolve duplicates
    sql/item_sum.h:
      New sum Item added - Item_sum_sum_distinct - for SUM(DISTINCT) function
    sql/sql_class.h:
      added walk() and reset() methods to Unique, used in Item_sum_sum_distinct.
    sql/sql_sort.h:
      declaration for reuse_freed_buff() to be able to use it in uniques.cc
    sql/sql_yacc.yy:
      parser extended to handle MIN(DISTICNT), MAX(DISTINCT), SUM(DISTINCT)
    sql/uniques.cc:
      Implementation for Unique::reset(), Unique::walk() as well as for merge_walk() 
      algorithm.
    58a52a2a
item_sum.h 23 KB