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

Function setup_new_fields

sql/sql_select.cc:29192–29217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29190*/
29191
29192static bool
29193setup_new_fields(THD *thd, List<Item> &fields,
29194 List<Item> &all_fields, ORDER *new_field)
29195{
29196 Item **item;
29197 uint counter;
29198 enum_resolution_type not_used;
29199 DBUG_ENTER("setup_new_fields");
29200
29201 thd->column_usage= MARK_COLUMNS_READ; // Not really needed, but...
29202 for (; new_field ; new_field= new_field->next)
29203 {
29204 if ((item= find_item_in_list(*new_field->item, fields, &counter,
29205 IGNORE_ERRORS, &not_used)))
29206 new_field->item=item; /* Change to shared Item */
29207 else
29208 {
29209 thd->where= THD_WHERE::PROCEDURE_LIST;
29210 if ((*new_field->item)->fix_fields(thd, new_field->item))
29211 DBUG_RETURN(1); /* purecov: inspected */
29212 all_fields.push_front(*new_field->item, thd->mem_root);
29213 new_field->item=all_fields.head_ref();
29214 }
29215 }
29216 DBUG_RETURN(0);
29217}
29218
29219/**
29220 Create a group by that consist of all non const fields.

Callers 1

prepareMethod · 0.85

Calls 4

find_item_in_listFunction · 0.85
fix_fieldsMethod · 0.45
push_frontMethod · 0.45
head_refMethod · 0.45

Tested by

no test coverage detected