Loading sql/sql_select.cc +18 −6 Original line number Diff line number Diff line Loading @@ -1365,11 +1365,12 @@ JOIN::exec() DBUG_VOID_RETURN; } /* don't reset the found rows count if there're no tables as FOUND_ROWS() may be called. Don't reset the found rows count if there're no tables as FOUND_ROWS() may be called. Never reset the examined row count here. It must be accumulated from all join iterations of all join parts. */ if (tables) thd->limit_found_rows= thd->examined_row_count= 0; thd->limit_found_rows= 0; if (zero_result_cause) { Loading Loading @@ -1417,6 +1418,12 @@ JOIN::exec() List<Item> *curr_all_fields= &all_fields; List<Item> *curr_fields_list= &fields_list; TABLE *curr_tmp_table= 0; /* Initialize examined rows here because the values from all join parts must be accumulated in examined_row_count. Hence every join iteration must count from zero. */ curr_join->examined_rows= 0; if ((curr_join->select_lex->options & OPTION_SCHEMA_TABLE) && get_schema_tables_result(curr_join)) Loading Loading @@ -1823,9 +1830,12 @@ JOIN::exec() Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF); error= do_select(curr_join, curr_fields_list, NULL, procedure); thd->limit_found_rows= curr_join->send_records; thd->examined_row_count= curr_join->examined_rows; } /* Accumulate the counts from all join iterations of all join parts. */ thd->examined_row_count+= curr_join->examined_rows; DBUG_PRINT("counts", ("thd->examined_row_count: %lu", (ulong) thd->examined_row_count)); DBUG_VOID_RETURN; } Loading Loading @@ -10129,6 +10139,8 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, */ join->examined_rows++; join->thd->row_count++; DBUG_PRINT("counts", ("join->examined_rows++: %lu", (ulong) join->examined_rows)); if (found) { Loading Loading
sql/sql_select.cc +18 −6 Original line number Diff line number Diff line Loading @@ -1365,11 +1365,12 @@ JOIN::exec() DBUG_VOID_RETURN; } /* don't reset the found rows count if there're no tables as FOUND_ROWS() may be called. Don't reset the found rows count if there're no tables as FOUND_ROWS() may be called. Never reset the examined row count here. It must be accumulated from all join iterations of all join parts. */ if (tables) thd->limit_found_rows= thd->examined_row_count= 0; thd->limit_found_rows= 0; if (zero_result_cause) { Loading Loading @@ -1417,6 +1418,12 @@ JOIN::exec() List<Item> *curr_all_fields= &all_fields; List<Item> *curr_fields_list= &fields_list; TABLE *curr_tmp_table= 0; /* Initialize examined rows here because the values from all join parts must be accumulated in examined_row_count. Hence every join iteration must count from zero. */ curr_join->examined_rows= 0; if ((curr_join->select_lex->options & OPTION_SCHEMA_TABLE) && get_schema_tables_result(curr_join)) Loading Loading @@ -1823,9 +1830,12 @@ JOIN::exec() Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF); error= do_select(curr_join, curr_fields_list, NULL, procedure); thd->limit_found_rows= curr_join->send_records; thd->examined_row_count= curr_join->examined_rows; } /* Accumulate the counts from all join iterations of all join parts. */ thd->examined_row_count+= curr_join->examined_rows; DBUG_PRINT("counts", ("thd->examined_row_count: %lu", (ulong) thd->examined_row_count)); DBUG_VOID_RETURN; } Loading Loading @@ -10129,6 +10139,8 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, */ join->examined_rows++; join->thd->row_count++; DBUG_PRINT("counts", ("join->examined_rows++: %lu", (ulong) join->examined_rows)); if (found) { Loading