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

Method prepare_tmp_table

sql/sql_select.cc:33809–33840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33807*/
33808
33809bool
33810AGGR_OP::prepare_tmp_table()
33811{
33812 TABLE *table= join_tab->table;
33813 JOIN *join= join_tab->join;
33814 int rc= 0;
33815
33816 if (!join_tab->table->is_created())
33817 {
33818 if (instantiate_tmp_table(table, join_tab->tmp_table_param->keyinfo,
33819 join_tab->tmp_table_param->start_recinfo,
33820 &join_tab->tmp_table_param->recinfo,
33821 join->select_options))
33822 return true;
33823 (void) table->file->extra(HA_EXTRA_WRITE_CACHE);
33824 }
33825 /* If it wasn't already, start index scan for grouping using table index. */
33826 if (!table->file->inited && table->group &&
33827 join_tab->tmp_table_param->sum_func_count && table->s->keys)
33828 rc= table->file->ha_index_init(0, 0);
33829 else
33830 {
33831 /* Start index scan in scanning mode */
33832 rc= table->file->ha_rnd_init(true);
33833 }
33834 if (rc)
33835 {
33836 table->file->print_error(rc, MYF(0));
33837 return true;
33838 }
33839 return false;
33840}
33841
33842
33843/**

Callers

nothing calls this directly

Calls 6

instantiate_tmp_tableFunction · 0.85
ha_index_initMethod · 0.80
ha_rnd_initMethod · 0.80
is_createdMethod · 0.45
extraMethod · 0.45
print_errorMethod · 0.45

Tested by

no test coverage detected