Skip to content

Commit

Permalink
cleanup: reorder TABLE members
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Dec 12, 2016
1 parent 0ed291e commit 5b716bc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion sql/sql_insert.cc
Expand Up @@ -1518,7 +1518,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,

if (!table)
table= table_list->table;
if (table->s->virtual_stored_fields)
if (table->s->has_virtual_stored_fields)
thd->lex->unit.insert_table_with_stored_vcol= table;

if (!select_insert)
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_load.cc
Expand Up @@ -410,7 +410,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,

table->prepare_triggers_for_insert_stmt_or_event();
table->mark_columns_needed_for_insert();
if (table->s->virtual_stored_fields)
if (table->s->has_virtual_stored_fields)
thd->lex->unit.insert_table_with_stored_vcol= table;

uint tot_length=0;
Expand Down
2 changes: 1 addition & 1 deletion sql/table.cc
Expand Up @@ -2233,7 +2233,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
DBUG_ASSERT(!reg_field->vcol_info);
reg_field->vcol_info= vcol_info;
share->virtual_fields++;
share->virtual_stored_fields= true; // For insert/load data
share->has_virtual_stored_fields=true; // For insert/load data
break;
case 2: // Default expression
vcol_info->stored_in_db= 1;
Expand Down
31 changes: 16 additions & 15 deletions sql/table.h
Expand Up @@ -644,17 +644,22 @@ struct TABLE_SHARE
the record then this value is 0.
*/
uint null_bytes_for_compare;
uint fields; /* Number of fields */
/* Number of stored fields, generated-only virtual fields are not included */
uint stored_fields;
uint fields; /* number of fields */
uint stored_fields; /* number of stored fields, purely virtual not included */
uint virtual_fields; /* number of purely virtual fields */
uint null_fields; /* number of null fields */
uint blob_fields; /* number of blob fields */
uint varchar_fields; /* number of varchar fields */
uint default_fields; /* number of default fields */

uint default_expressions;
uint table_check_constraints, field_check_constraints;

uint rec_buff_length; /* Size of table->record[] buffer */
uint keys, key_parts;
uint ext_key_parts; /* Total number of key parts in extended keys */
uint max_key_length, max_unique_length, total_key_length;
uint uniques; /* Number of UNIQUE index */
uint null_fields; /* number of null fields */
uint blob_fields; /* number of blob fields */
uint varchar_fields; /* number of varchar fields */
uint db_create_options; /* Create options from database */
uint db_options_in_use; /* Options in use */
uint db_record_offset; /* if HA_REC_IN_SEQ */
Expand All @@ -668,10 +673,7 @@ struct TABLE_SHARE
uint open_errno; /* error from open_table_def() */
uint column_bitmap_size;
uchar frm_version;
uint virtual_fields;
uint default_expressions;
uint table_check_constraints, field_check_constraints;
uint default_fields; /* Number of default fields */

bool use_ext_keys; /* Extended keys can be used */
bool null_field_first;
bool system; /* Set if system table (one record) */
Expand All @@ -682,7 +684,7 @@ struct TABLE_SHARE
bool table_creation_was_logged;
bool non_determinstic_insert;
bool vcols_need_refixing;
bool virtual_stored_fields;
bool has_virtual_stored_fields;
bool check_set_initialized;
bool has_update_default_function;
ulong table_map_id; /* for row-based replication */
Expand Down Expand Up @@ -1029,7 +1031,6 @@ struct TABLE

uint32 instance; /** Table cache instance this TABLE is belonging to */
THD *in_use; /* Which thread uses this */
Field **field; /* Pointer to fields */

uchar *record[2]; /* Pointer to records */
uchar *write_row_record; /* Used as optimisation in
Expand Down Expand Up @@ -1059,11 +1060,11 @@ struct TABLE
key_map keys_in_use_for_order_by;
KEY *key_info; /* data of keys in database */

Field **field; /* Pointer to fields */
Field **vfield; /* Pointer to virtual fields*/
Field **default_field; /* Fields with non-constant DEFAULT */
Field *next_number_field; /* Set if next_number is activated */
Field *found_next_number_field; /* Set on open */
Field **vfield; /* Pointer to virtual fields*/
/* Fields that are updated automatically on INSERT or UPDATE. */
Field **default_field;
Virtual_column_info **check_constraints;

/* Table's triggers, 0 if there are no of them */
Expand Down

0 comments on commit 5b716bc

Please sign in to comment.