• unknown's avatar
    Bug #25551: inconsistent behaviour in grouping NULL, depending on index type · 3a42c810
    unknown authored
     The optimizer takes away columns from GROUP BY/DISTINCT if they constitute
     all the parts of an unique index.
     However if some of the columns can contain NULLs this cannot be done 
    (because an UNIQUE index can have multiple rows with NULL values).
     Fixed by not using UNIQUE indexes with nullable columns to remove
     grouping columns from GROUP BY/DISTINCT.
    
    
    mysql-test/r/distinct.result:
      Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
       - test case
    mysql-test/t/distinct.test:
      Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
       - test case
    sql/sql_select.cc:
      Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
       - UNIQUE NULL indices don't guarantee GROUP BY/DISTINCT.
    3a42c810
distinct.test 18.7 KB