summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <mhansson/martin@linux-st28.site>2007-05-15 15:29:12 +0300
committerunknown <mhansson/martin@linux-st28.site>2007-05-15 15:29:12 +0300
commitaaf6acae9be9b732c023a7d7ce94cb66f4a61de6 (patch)
tree56b80b70ec60a2d2a552a5513a6132a311e2dd4c /ndb
parentd03c7d2d28fe86d88c30f8799b78cf966e5a3ab7 (diff)
downloadmariadb-git-aaf6acae9be9b732c023a7d7ce94cb66f4a61de6.tar.gz
Bug#27573: MIN() on an indexed column which is always NULL sets _other_ results
to NULL For queries of the form SELECT MIN(key_part_k) FROM t1 WHERE key_part_1 = const and ... and key_part_k-1 = const, the opt_sum_query optimization tries to use an index to substitute MIN/MAX functions with their values according to the following rules: 1) Insert the minimum non-null values where the WHERE clause still matches, or 3) A row of nulls However, the correct semantics requires that there is a third case 2) such that a NULL value is substituted if there are only NULL values for key_part_k. The patch modifies opt_sum_query() to handle this missing case. mysql-test/r/func_group.result: Bug #27573: Correct result mysql-test/t/func_group.test: Bug #27573: test case sql/opt_sum.cc: Bug #27573: Added code that will try to read the first non-null value for a given complete-field prefix, second choice is to read the null, and lastly set the error code if no row is found.
Diffstat (limited to 'ndb')
0 files changed, 0 insertions, 0 deletions