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

Method add

sql/sql_select.h:2390–2407  ·  view source on GitHub ↗

Add one Field to the end of the field array, update members: s->reclength, s->fields, s->blob_fields, s->null_fuelds. */

Source from the content-addressed store, hash-verified

2388 s->reclength, s->fields, s->blob_fields, s->null_fuelds.
2389 */
2390 bool add(Field *new_field)
2391 {
2392 DBUG_ASSERT(s->fields < m_alloced_field_count);
2393 new_field->init(this);
2394 field[s->fields]= new_field;
2395 s->reclength+= new_field->pack_length();
2396 if (!(new_field->flags & NOT_NULL_FLAG))
2397 s->null_fields++;
2398 if (new_field->flags & BLOB_FLAG)
2399 {
2400 // Note, s->blob_fields was incremented in Field_blob::Field_blob
2401 DBUG_ASSERT(s->blob_fields);
2402 DBUG_ASSERT(s->blob_fields <= m_alloced_field_count);
2403 s->blob_field[s->blob_fields - 1]= s->fields;
2404 }
2405 new_field->field_index= s->fields++;
2406 return false;
2407 }
2408
2409 /**
2410 Add fields from a Spvar_definition list

Callers 1

create_virtual_tmp_tableFunction · 0.45

Calls 2

initMethod · 0.45
pack_lengthMethod · 0.45

Tested by

no test coverage detected