diff options
| author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-12-08 14:28:06 +0200 |
|---|---|---|
| committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-12-08 14:28:06 +0200 |
| commit | 4e9fb2c76f65e9949ebd3bbe2608f6a3b80a3822 (patch) | |
| tree | 843cd564016bb7ea84119c7bbc818afe1b4cd412 /sql/sql_select.cc | |
| parent | 703014b807b6971e07c244c662a070bb6700581a (diff) | |
| download | mariadb-git-4e9fb2c76f65e9949ebd3bbe2608f6a3b80a3822.tar.gz | |
Bug #57954: BIT_AND function returns incorrect results
when semijoin=on
When setting the aggregate function as having no rows to report
the function no_rows_in_result() was calling Item_sum::reset().
However this function in addition to cleaning up the aggregate
value by calling aggregator_clear() was also adding the current
value to the aggregate value by calling aggregator_add().
Fixed by making no_rows_in_result() to call aggregator_clear()
directly.
Renamed Item_sum::reset to Item_sum::reset_and_add() to
and added a comment to avoid misinterpretation of what the
function does.
Diffstat (limited to 'sql/sql_select.cc')
| -rw-r--r-- | sql/sql_select.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ef2dd1d76e1..e4772bf3fb2 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -15850,7 +15850,7 @@ init_sum_functions(Item_sum **func_ptr, Item_sum **end_ptr) { for (; func_ptr != end_ptr ;func_ptr++) { - if ((*func_ptr)->reset()) + if ((*func_ptr)->reset_and_add()) return 1; } /* If rollup, calculate the upper sum levels */ |
