summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index a331f4f3dbc..a7e2ac4e374 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -19146,11 +19146,8 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
*/
if (shortcut_for_distinct && found_records != join->found_records)
DBUG_RETURN(NESTED_LOOP_NO_MORE_ROWS);
- }
- else
- {
- join->thd->get_stmt_da()->inc_current_row_for_warning();
- join_tab->read_record.unlock_row(join_tab);
+
+ DBUG_RETURN(NESTED_LOOP_OK);
}
}
else
@@ -19160,9 +19157,11 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
with the beginning coinciding with the current partial join.
*/
join->join_examined_rows++;
- join->thd->get_stmt_da()->inc_current_row_for_warning();
- join_tab->read_record.unlock_row(join_tab);
}
+
+ join->thd->get_stmt_da()->inc_current_row_for_warning();
+ join_tab->read_record.unlock_row(join_tab);
+
DBUG_RETURN(NESTED_LOOP_OK);
}
@@ -26945,6 +26944,12 @@ AGGR_OP::end_send()
table->reginfo.lock_type= TL_UNLOCK;
bool in_first_read= true;
+
+ /*
+ Reset the counter before copying rows from internal temporary table to
+ INSERT table.
+ */
+ join_tab->join->thd->get_stmt_da()->reset_current_row_for_warning();
while (rc == NESTED_LOOP_OK)
{
int error;