Skip to content

Commit 5b716bc

Browse files
committed
cleanup: reorder TABLE members
1 parent 0ed291e commit 5b716bc

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

sql/sql_insert.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
15181518

15191519
if (!table)
15201520
table= table_list->table;
1521-
if (table->s->virtual_stored_fields)
1521+
if (table->s->has_virtual_stored_fields)
15221522
thd->lex->unit.insert_table_with_stored_vcol= table;
15231523

15241524
if (!select_insert)

sql/sql_load.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
410410

411411
table->prepare_triggers_for_insert_stmt_or_event();
412412
table->mark_columns_needed_for_insert();
413-
if (table->s->virtual_stored_fields)
413+
if (table->s->has_virtual_stored_fields)
414414
thd->lex->unit.insert_table_with_stored_vcol= table;
415415

416416
uint tot_length=0;

sql/table.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
22332233
DBUG_ASSERT(!reg_field->vcol_info);
22342234
reg_field->vcol_info= vcol_info;
22352235
share->virtual_fields++;
2236-
share->virtual_stored_fields= true; // For insert/load data
2236+
share->has_virtual_stored_fields=true; // For insert/load data
22372237
break;
22382238
case 2: // Default expression
22392239
vcol_info->stored_in_db= 1;

sql/table.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -644,17 +644,22 @@ struct TABLE_SHARE
644644
the record then this value is 0.
645645
*/
646646
uint null_bytes_for_compare;
647-
uint fields; /* Number of fields */
648-
/* Number of stored fields, generated-only virtual fields are not included */
649-
uint stored_fields;
647+
uint fields; /* number of fields */
648+
uint stored_fields; /* number of stored fields, purely virtual not included */
649+
uint virtual_fields; /* number of purely virtual fields */
650+
uint null_fields; /* number of null fields */
651+
uint blob_fields; /* number of blob fields */
652+
uint varchar_fields; /* number of varchar fields */
653+
uint default_fields; /* number of default fields */
654+
655+
uint default_expressions;
656+
uint table_check_constraints, field_check_constraints;
657+
650658
uint rec_buff_length; /* Size of table->record[] buffer */
651659
uint keys, key_parts;
652660
uint ext_key_parts; /* Total number of key parts in extended keys */
653661
uint max_key_length, max_unique_length, total_key_length;
654662
uint uniques; /* Number of UNIQUE index */
655-
uint null_fields; /* number of null fields */
656-
uint blob_fields; /* number of blob fields */
657-
uint varchar_fields; /* number of varchar fields */
658663
uint db_create_options; /* Create options from database */
659664
uint db_options_in_use; /* Options in use */
660665
uint db_record_offset; /* if HA_REC_IN_SEQ */
@@ -668,10 +673,7 @@ struct TABLE_SHARE
668673
uint open_errno; /* error from open_table_def() */
669674
uint column_bitmap_size;
670675
uchar frm_version;
671-
uint virtual_fields;
672-
uint default_expressions;
673-
uint table_check_constraints, field_check_constraints;
674-
uint default_fields; /* Number of default fields */
676+
675677
bool use_ext_keys; /* Extended keys can be used */
676678
bool null_field_first;
677679
bool system; /* Set if system table (one record) */
@@ -682,7 +684,7 @@ struct TABLE_SHARE
682684
bool table_creation_was_logged;
683685
bool non_determinstic_insert;
684686
bool vcols_need_refixing;
685-
bool virtual_stored_fields;
687+
bool has_virtual_stored_fields;
686688
bool check_set_initialized;
687689
bool has_update_default_function;
688690
ulong table_map_id; /* for row-based replication */
@@ -1029,7 +1031,6 @@ struct TABLE
10291031

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

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

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

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

0 commit comments

Comments
 (0)