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

Method rollup_write_data

sql/sql_select.cc:30868–30901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30866*/
30867
30868int JOIN::rollup_write_data(uint idx, TMP_TABLE_PARAM *tmp_table_param_arg,
30869 TABLE *table_arg)
30870{
30871 uint i;
30872 for (i= send_group_parts ; i-- > idx ; )
30873 {
30874 /* Get reference pointers to sum functions in place */
30875 copy_ref_ptr_array(ref_ptrs, rollup.ref_pointer_arrays[i]);
30876 if ((!having || having->val_bool()))
30877 {
30878 int write_error;
30879 Item *item;
30880 List_iterator_fast<Item> it(rollup.fields[i]);
30881 while ((item= it++))
30882 {
30883 if (item->type() == Item::NULL_ITEM && item->is_result_field())
30884 item->save_in_result_field(1);
30885 }
30886 copy_sum_funcs(sum_funcs_end[i+1], sum_funcs_end[i]);
30887 if (unlikely((write_error=
30888 table_arg->file->ha_write_tmp_row(table_arg->record[0]))))
30889 {
30890 if (create_internal_tmp_table_from_heap(thd, table_arg,
30891 tmp_table_param_arg->start_recinfo,
30892 &tmp_table_param_arg->recinfo,
30893 write_error, 0, NULL))
30894 return 1;
30895 }
30896 }
30897 }
30898 /* Restore ref_pointer_array */
30899 set_items_ref_array(current_ref_ptrs);
30900 return 0;
30901}
30902
30903/**
30904 clear results if there are not rows found for group

Callers 1

end_write_groupFunction · 0.80

Calls 6

copy_sum_funcsFunction · 0.85
val_boolMethod · 0.45
typeMethod · 0.45
is_result_fieldMethod · 0.45
save_in_result_fieldMethod · 0.45

Tested by

no test coverage detected