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

Method reinit

sql/sql_select.cc:4731–4788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4729
4730
4731int
4732JOIN::reinit()
4733{
4734 DBUG_ENTER("JOIN::reinit");
4735
4736 first_record= false;
4737 group_sent= false;
4738 cleaned= false;
4739 accepted_rows= 0;
4740
4741 if (aggr_tables)
4742 {
4743 JOIN_TAB *curr_tab= join_tab + exec_join_tab_cnt();
4744 JOIN_TAB *end_tab= curr_tab + aggr_tables;
4745 for ( ; curr_tab < end_tab; curr_tab++)
4746 {
4747 TABLE *tmp_table= curr_tab->table;
4748 if (!tmp_table->is_created())
4749 continue;
4750 tmp_table->file->extra(HA_EXTRA_RESET_STATE);
4751 tmp_table->file->ha_delete_all_rows();
4752 }
4753 }
4754 clear_sj_tmp_tables(this);
4755 if (current_ref_ptrs != items0)
4756 {
4757 set_items_ref_array(items0);
4758 }
4759
4760 /* need to reset ref access state (see join_read_key) */
4761 if (join_tab)
4762 {
4763 JOIN_TAB *tab;
4764 for (tab= first_linear_tab(this, WITH_BUSH_ROOTS, WITH_CONST_TABLES); tab;
4765 tab= next_linear_tab(this, tab, WITH_BUSH_ROOTS))
4766 {
4767 tab->ref.key_err= TRUE;
4768 }
4769 }
4770
4771 clear_sum_funcs();
4772
4773 if (no_rows_in_result_called)
4774 {
4775 /* Reset effect of possible no_rows_in_result() */
4776 List_iterator_fast<Item> it(fields_list);
4777 Item *item;
4778 no_rows_in_result_called= 0;
4779 while ((item= it++))
4780 item->restore_to_before_no_rows_in_result();
4781 }
4782
4783 if (!(select_options & SELECT_DESCRIBE))
4784 if (init_ftfuncs(thd, select_lex, MY_TEST(order)))
4785 DBUG_RETURN(1);
4786
4787 DBUG_RETURN(0);
4788}

Callers 1

mysql_selectFunction · 0.45

Calls 8

clear_sj_tmp_tablesFunction · 0.85
first_linear_tabFunction · 0.85
next_linear_tabFunction · 0.85
init_ftfuncsFunction · 0.85
ha_delete_all_rowsMethod · 0.80
is_createdMethod · 0.45
extraMethod · 0.45

Tested by

no test coverage detected