summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_load.cc2
-rw-r--r--sql/table.cc2
-rw-r--r--sql/table.h31
4 files changed, 19 insertions, 18 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 8555ccd4806..88787acea18 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -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)
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index b1167534491..6bfe01ef6df 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -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;
diff --git a/sql/table.cc b/sql/table.cc
index 3bc1fee273b..d4d5d02e939 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -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;
diff --git a/sql/table.h b/sql/table.h
index bc30b00ac45..cf73a1ca12c 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -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 */
@@ -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) */
@@ -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 */
@@ -1029,7 +1031,6 @@ public:
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
@@ -1059,11 +1060,11 @@ public:
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 */