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

Function list_fields_send_default

sql/sql_prepare.cc:6233–6251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6231
6232
6233static void
6234list_fields_send_default(THD *thd, Protocol_local *p, Field *fld, uint pos)
6235{
6236 char buff[80];
6237 String tmp(buff, sizeof(buff), default_charset_info), *res;
6238 MYSQL_FIELD *client_field= &p->cur_data->embedded_info->fields_list[pos];
6239
6240 if (fld->is_null() || !(res= fld->val_str(&tmp)))
6241 {
6242 client_field->def_length= 0;
6243 client_field->def= strmake_root(&p->cur_data->alloc, "", 0);
6244 }
6245 else
6246 {
6247 client_field->def_length= res->length();
6248 client_field->def= strmake_root(&p->cur_data->alloc, res->ptr(),
6249 client_field->def_length);
6250 }
6251}
6252
6253
6254bool Protocol_local::send_list_fields(List<Field> *list, const TABLE_LIST *table_list)

Callers 1

send_list_fieldsMethod · 0.70

Calls 5

strmake_rootFunction · 0.85
is_nullMethod · 0.45
val_strMethod · 0.45
lengthMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected