summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-11-06 12:46:46 +0200
committerunknown <bell@sanja.is.com.ua>2004-11-06 12:46:46 +0200
commit79a33fa20ce3982b13999cd9a3d4e188d93cb643 (patch)
tree97d16784b93d49dd8dbfed746556c62941380973 /sql/table.h
parent9f9893c97139098f27795a8cd96ef4b131a94a9e (diff)
parent1ce11fe0416512f9a9a4133cd7feaf2c68a483d8 (diff)
downloadmariadb-git-79a33fa20ce3982b13999cd9a3d4e188d93cb643.tar.gz
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-view-5.0 mysql-test/r/view.result: Auto merged mysql-test/t/view.test: Auto merged sql/item_subselect.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_view.cc: Auto merged sql/table.h: Auto merged
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h40
1 files changed, 31 insertions, 9 deletions
diff --git a/sql/table.h b/sql/table.h
index de048e7cc5c..b5e3b5a6b44 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -70,6 +70,16 @@ typedef struct st_filesort_info
} FILESORT_INFO;
+/*
+ Values in this enum are used to indicate during which operations value
+ of TIMESTAMP field should be set to current timestamp.
+*/
+enum timestamp_auto_set_type
+{
+ TIMESTAMP_NO_AUTO_SET= 0, TIMESTAMP_AUTO_SET_ON_INSERT= 1,
+ TIMESTAMP_AUTO_SET_ON_UPDATE= 2, TIMESTAMP_AUTO_SET_ON_BOTH= 3
+};
+
/* Table cache entry struct */
class Field_timestamp;
@@ -113,16 +123,19 @@ struct st_table {
uint status; /* Used by postfix.. */
uint system; /* Set if system record */
- /*
- These two members hold offset in record + 1 for TIMESTAMP field
- with NOW() as default value or/and with ON UPDATE NOW() option.
- If 0 then such field is absent in this table or auto-set for default
- or/and on update should be temporally disabled for some reason.
- These values is setup to offset value for each statement in open_table()
- and turned off in statement processing code (see mysql_update as example).
+ /*
+ If this table has TIMESTAMP field with auto-set property (pointed by
+ timestamp_field member) then this variable indicates during which
+ operations (insert only/on update/in both cases) we should set this
+ field to current timestamp. If there are no such field in this table
+ or we should not automatically set its value during execution of current
+ statement then the variable contains TIMESTAMP_NO_AUTO_SET (i.e. 0).
+
+ Value of this variable is set for each statement in open_table() and
+ if needed cleared later in statement processing code (see mysql_update()
+ as example).
*/
- ulong timestamp_default_now;
- ulong timestamp_on_update_now;
+ timestamp_auto_set_type timestamp_field_type;
/* Index of auto-updated TIMESTAMP field in field array */
uint timestamp_field_offset;
@@ -151,6 +164,14 @@ struct st_table {
*found_next_number_field, /* Set on open */
*rowid_field;
Field_timestamp *timestamp_field;
+#if MYSQL_VERSION_ID < 40100
+ /*
+ Indicates whenever we have to set field_length members of all TIMESTAMP
+ fields to 19 (to honour 'new_mode' variable) or to original
+ field_length values.
+ */
+ my_bool timestamp_mode;
+#endif
my_string comment; /* Comment about table */
CHARSET_INFO *table_charset; /* Default charset of string fields */
REGINFO reginfo; /* field connections */
@@ -159,6 +180,7 @@ struct st_table {
/* Table's triggers, 0 if there are no of them */
Table_triggers_list *triggers;
+ /* A pair "database_name\0table_name\0", widely used as simply a db name */
char *table_cache_key;
char *table_name,*real_name,*path;
uint key_length; /* Length of key */