MCPcopy Create free account
hub / github.com/MariaDB/server / end_send

Method end_send

sql/sql_select.cc:33870–33954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33868*/
33869
33870enum_nested_loop_state
33871AGGR_OP::end_send()
33872{
33873 enum_nested_loop_state rc= NESTED_LOOP_OK;
33874 TABLE *table= join_tab->table;
33875 JOIN *join= join_tab->join;
33876
33877 // All records were stored, send them further
33878 int tmp, new_errno= 0;
33879
33880 if ((rc= put_record(true)) < NESTED_LOOP_OK)
33881 return rc;
33882
33883 if ((tmp= table->file->extra(HA_EXTRA_NO_CACHE)))
33884 {
33885 DBUG_PRINT("error",("extra(HA_EXTRA_NO_CACHE) failed"));
33886 new_errno= tmp;
33887 }
33888 if ((tmp= table->file->ha_index_or_rnd_end()))
33889 {
33890 DBUG_PRINT("error",("ha_index_or_rnd_end() failed"));
33891 new_errno= tmp;
33892 }
33893 if (new_errno)
33894 {
33895 table->file->print_error(new_errno,MYF(0));
33896 return NESTED_LOOP_ERROR;
33897 }
33898
33899 // Update ref array
33900 join_tab->join->set_items_ref_array(*join_tab->ref_array);
33901 bool keep_last_filesort_result = join_tab->filesort ? false : true;
33902 if (join_tab->window_funcs_step)
33903 {
33904 if (join_tab->window_funcs_step->exec(join, keep_last_filesort_result))
33905 return NESTED_LOOP_ERROR;
33906 }
33907
33908 table->reginfo.lock_type= TL_UNLOCK;
33909
33910 bool in_first_read= true;
33911
33912 /*
33913 Reset the counter before copying rows from internal temporary table to
33914 INSERT table.
33915 */
33916 join_tab->join->thd->get_stmt_da()->reset_current_row_for_warning(1);
33917 while (rc == NESTED_LOOP_OK)
33918 {
33919 int error;
33920 if (in_first_read)
33921 {
33922 in_first_read= false;
33923 error= join_init_read_record(join_tab);
33924 }
33925 else
33926 error= join_tab->read_record.read_record();
33927

Callers 2

do_selectFunction · 0.80
sub_select_postjoin_aggrFunction · 0.80

Calls 13

join_init_read_recordFunction · 0.85
evaluate_join_recordFunction · 0.85
ha_index_or_rnd_endMethod · 0.80
set_items_ref_arrayMethod · 0.80
get_stmt_daMethod · 0.80
read_recordMethod · 0.80
send_kill_messageMethod · 0.80
extraMethod · 0.45
print_errorMethod · 0.45
execMethod · 0.45
is_errorMethod · 0.45

Tested by

no test coverage detected