• unknown's avatar
    WL#926 "AVG(DISTINCT) and other distincts", part 2 (out of 3): clean up · 897849e5
    unknown authored
    Item_sum_count_distinct, and
    deploy Unique for use with COUNT(DISTINCT) if there is no blob
    column in the list of DISTINCT arguments.
    
    
    mysql-test/r/count_distinct2.result:
      Test results fixed.
    mysql-test/r/func_group.result:
      Updated.
    mysql-test/r/sum_distinct.result:
      Updated.
    mysql-test/t/func_group.test:
      Add a test for COUNT(DISTINCT) and true varchar and case-insensitive
      collation. The table in the test contains only two distinct values.
    mysql-test/t/sum_distinct.test:
      Since now we support INSERT INTO t1 (a) SELECT a+1 FROM t1, shorten
      the test.
      Add a nominal test for AVG(DISTINCT)
    sql/item_sum.cc:
      Implementation of cleaned up Item_sum_count_distinct.
      Fixed a bug with COUNT(DISTINCT) and new VARCHAR and collations.
      Fixed a bug wiht AVG(DISTINCT) and wrong number of output digits
      after decimal point.
    sql/item_sum.h:
      Cleanup for Item_sum_count_distinct.
      Now if the list of distinct arguments doesn't contain a blob column,
      we always use Unique and merge-sort to find distinct values.
    sql/sql_class.h:
      Added a short-cut to find number of elements in Unique if all elements fit
      into memory.
    897849e5
item_sum.cc 72.7 KB