3589 Tor Didriksen 2011-02-02 [merge]
Empty merge of Backport of fix for Bug#52123
3588 Ole John Aske 2011-02-02
Fix for bug#56690 'Wrong results with subquery with
GROUP BY inside < ANY clause'
A subquery of the form :
1) SELECT ... WHERE <column> < ANY(select <column>...)
Is transformed into the form by the optimizer:
2) SELECT ... WHERE <column> < (select MAX(<column>)...)
The Min/Max aggregation of subquery columns is implemented in
'class select_max_min_finder_subselect'.
The handling of NULL values in this implementation was incorrect as
they was interpreted as a NULL-value being '>' than any other value being
compared. This is incorrect wrt. SQL semantics which specifies that
NULL values are 'undefined' and should be removed as soon as a non-NULL
value is encountered.
This fix changes implementation of all
select_max_min_finder_subselect::cmp_<type>() methods to follow the
correct SQL semantics as described above. (Which also simplifies the
logic IMHO)
It also changes the methods to be 'private' within
class select_max_min_finder_subselect.
modified:
mysql-test/include/subquery.inc
mysql-test/r/subquery_nomat_nosj.result
mysql-test/r/subquery_none.result
sql/sql_class.cc
sql/sql_class.h
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (tor.didriksen:3588 to 3589) Bug#52123 | Tor Didriksen | 2 Feb |