Create field for temporary table. @param table Temporary table @param item Item to create a field for @param type Type of item (normally item->type) @param copy_func If set and item is a function, store copy of item in this array @param from_field if field will be created using other field as example, pointer
| 21901 | either direct or referenced by an Item_ref. |
| 21902 | */ |
| 21903 | Field *create_tmp_field(TABLE *table, Item *item, |
| 21904 | Item ***copy_func, Field **from_field, |
| 21905 | Field **default_field, |
| 21906 | bool group, bool modify_item, |
| 21907 | bool table_cant_handle_bit_fields, |
| 21908 | bool make_copy_field) |
| 21909 | { |
| 21910 | Tmp_field_src src; |
| 21911 | Tmp_field_param prm(group, modify_item, table_cant_handle_bit_fields, |
| 21912 | make_copy_field); |
| 21913 | Field *result= item->create_tmp_field_ex(table->in_use->mem_root, |
| 21914 | table, &src, &prm); |
| 21915 | if (is_json_type(item) && make_json_valid_expr(table, result)) |
| 21916 | result= NULL; |
| 21917 | |
| 21918 | *from_field= src.field(); |
| 21919 | *default_field= src.default_field(); |
| 21920 | if (src.item_result_field()) |
| 21921 | *((*copy_func)++)= src.item_result_field(); |
| 21922 | return result; |
| 21923 | } |
| 21924 | |
| 21925 | /* |
| 21926 | Set up column usage bitmaps for a temporary table |
no test coverage detected