diff options
author | monty@donna.mysql.fi <> | 2001-04-21 17:12:59 +0300 |
---|---|---|
committer | monty@donna.mysql.fi <> | 2001-04-21 17:12:59 +0300 |
commit | 1e3df575b93b40145ff854e30af3f443d74537b6 (patch) | |
tree | 92c2e4e17ada35f43a9188e384c11136d46b1e7d /sql/sql_select.cc | |
parent | 0f37b1244b8356f32ef58245d94a3a920e047428 (diff) | |
download | mariadb-git-1e3df575b93b40145ff854e30af3f443d74537b6.tar.gz |
Fixed probelm with count(*) and normal functions when no matchin rows.
Changed 'lib' to 'master-data'
Fix for slow slaves
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 00a41a851b5..63d08b6be5b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4643,7 +4643,11 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), else { if (!join->first_record) + { + /* No matching rows for group function */ clear_tables(join); + copy_fields(&join->tmp_table_param); + } if (join->having && join->having->val_int() == 0) error= -1; // Didn't satisfy having else @@ -4875,7 +4879,11 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), if (idx < (int) join->send_group_parts) { if (!join->first_record) + { + /* No matching rows for group function */ clear_tables(join); + copy_fields(&join->tmp_table_param); + } copy_sum_funcs(join->sum_funcs); if (!join->having || join->having->val_int()) { @@ -4899,7 +4907,6 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), } if (idx < (int) join->send_group_parts) { - copy_fields(&join->tmp_table_param); copy_funcs(join->tmp_table_param.funcs); init_sum_functions(join->sum_funcs); if (join->procedure) |