mariadb/include
unknown 32b28f9298 WL#1266 "Separate auto-set logic from TIMESTAMP type."
Final version of patch.

Adds support for specifying of DEFAULT NOW() and/or ON UPDATE NOW()
clauses for TIMESTAMP field definition.
Current implementation allows only one such field per table and
uses several unireg types for storing info about this properties of
field. It should be replaced with better implementation when new
.frm format is introduced.


include/mysqld_error.h:
  Added error codes for case when we have more than one column with NOW()
  in DEFAULT or ON UPDATE clauses and for case when we are using ON UPDATE
  clause with wrong type.
mysql-test/r/create.result:
  Added tests for using of DEFAULT NOW() and ON UPDATE NOW() with
  non-TIMESTAMP fields.
mysql-test/r/show_check.result:
  Updated test results to reflect new default look of TIMESTAMP fields
  in SHOW CREATE TABLE.
mysql-test/r/system_mysql_db.result:
  Updated test results to reflect new default look of TIMESTAMP fields
  in SHOW CREATE TABLE.
mysql-test/r/type_ranges.result:
  Updated test results to reflect new default look of TIMESTAMP fields
  in SHOW COLUMNS.
mysql-test/r/type_timestamp.result:
  Added tests for various DEFAULT and ON UPDATE clauses for TIMESTAMP
  fields definitions.
mysql-test/t/create.test:
  Added tests for using of DEFAULT NOW() and ON UPDATE NOW() with
  non-TIMESTAMP fields.
mysql-test/t/type_timestamp.test:
  Added tests for various DEFAULT and ON UPDATE clauses for TIMESTAMP
  fields definitions.
sql/field.cc:
  Added support for various combinations of DEFAULT and ON UPDATE clauses
  for TIMESTAMP field. 
  
  Setting TABLE::timestamp* members for TIMESTAMP fields with auto-set 
  option taking into account their unireg type (which corresponds to 
  various DEFAULT/ON UPDATE values combinations). Replaced 
  TABLE::time_stamp with TABLE::timestamp_default_now/on_update_now
  couple moved their setup to separate method set_timestamp_offsets(),
  which now is called from  open_table instead of Field_timestamp cons.
sql/field.h:
  Added more unireg types for handling of DEFAULT NOW() and ON UPDATE
  NOW() for TIMESTAMP fields.
  Fixed value corresponding to DEFAULT item for TIMESTAMP field.
sql/ha_berkeley.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_heap.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_innodb.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_isam.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_isammrg.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_myisam.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/ha_myisammrg.cc:
  Now TIMESTAMP column with auto-set property could be updated during
  INSERT or/and UPDATE independently.
sql/item_func.h:
  We need to distinguish NOW() from other function for using in 
  DEFAULT and in ON UPDATE clauses.
sql/item_timefunc.h:
  We need to distinguish NOW() from other function for using in 
  DEFAULT and in ON UPDATE clauses.
sql/mysql_priv.h:
  Added parameter for ON UPDATE value to add_field_to_list() function.
sql/share/czech/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/danish/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/dutch/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/english/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/estonian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/french/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/german/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/greek/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/hungarian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/italian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/japanese/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/korean/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/norwegian-ny/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/norwegian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/polish/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/portuguese/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/romanian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/russian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/serbian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/slovak/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/spanish/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/swedish/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/share/ukrainian/errmsg.txt:
  Added error messages for case when we have more than one column with
  NOW() (CURRENT_TIMESTAMP is just more standard alias) in DEFAULT or 
  ON UPDATE clauses and for case when we are using ON UPDATE clause with
  wrong type.
sql/sql_base.cc:
  Added setup of TABLE::timestamp_default_now/on_update_now pair
  for each statement to open_table().
sql/sql_insert.cc:
  Using TABLE::timestamp_default_now/on_update_now pair instead of
  old TABLE::time_stamp. Added check for case then REPLACE could not
  be converted to UPDATE because of different DEFAULT/ON UPDATE values
  for TIMESTAMP field.
sql/sql_lex.h:
  Added member for value used in ON UPDATE clause to st_lex.
sql/sql_load.cc:
  Using TABLE::timestamp_default_now/on_update_now pair instead of
  old TABLE::time_stamp. We don't need to restore these members
  since they are set up for each statement in open_table().
sql/sql_parse.cc:
  Added handling of DEFAULT NOW() and ON UPDATE NOW() clauses for
  TIMESTAMP fields to add_field_to_list() function.
sql/sql_show.cc:
  Added support for DEFAULT CURRENT_TIMESTAMP (aka NOW() ) and 
  ON UPDATE CURRENT_TIMESTAMP to SHOW CREATE TABLE and SHOW COLUMNS.
sql/sql_table.cc:
  mysql_create_table() function - added check for number of TIMESTAMP 
    fields with auto-set values and replacing of old style TIMESTAMPs
    with their newer analogs.
  mysql_alter_table(): Using TABLE::timestamp_default_now/on_update_now 
    pair instead of old TABLE::time_stamp. We don't need to restore these
    members since they are set up for each statement in open_table().
sql/sql_update.cc:
  Left only setting of TABLE::timestamp_default_now/on_update_now
  to 0 since they should be already set up in open_table().
sql/sql_yacc.yy:
  Added support for DEFAULT NOW() and ON UPDATE NOW() in field
  definitions.
sql/table.h:
  Replaced TABLE::time_stamp withTABLE::timestamp_default_now/timestamp_on_update_now
  pair which allows to distinguish TIMESTAMP's with various DEFAULT/ON UPDATE
  clauses and optimize checks if TIMESTAMP field should be set to NOW()
  in handlers.
sql/unireg.cc:
  Now we are marking only TIMESTAMP fields with NOW() as default or
  as on update value as special field for unireg.
2004-04-02 10:12:53 +04:00
..
.cvsignore
config-netware.h
config-os2.h Implemented UTC_TIME, UTC_DATE and UTC_TIMESTAMP functions (WL#345) 2003-08-11 23:43:01 +04:00
config-win.h Fix of compilation failure of latest 4.1 tree: new constants in mysqld.cc 2004-03-15 22:39:36 +03:00
errmsg.h Added test to show bug in current union implementation 2004-03-19 18:33:38 +02:00
ft_global.h ft_boolean_syntax made changeable 2004-02-16 18:53:00 +01:00
hash.h Merge key cache structures to one 2003-11-20 22:06:25 +02:00
heap.h After merge fixes 2004-02-16 10:03:25 +02:00
keycache.h mf_keycache.c, keycache.h: 2003-11-25 10:40:14 -08:00
m_ctype.h Unicode Collation Algorithm subset implementation 2004-03-24 16:16:08 +04:00
m_string.h Merge with 4.0 to get lastest bug fixes 2004-03-29 19:21:53 +03:00
Makefile.am Added missing file keycache.h 2003-11-21 12:22:51 +02:00
md5.h
merge.h
my_aes.h
my_alarm.h
my_alloc.h
my_base.h WL#1648 - Start/Stop Inserting Duplicates Into a Table 2004-03-18 16:47:16 +01:00
my_bitmap.h Bitmap post-review fixes 2003-10-30 19:17:57 +01:00
my_dbug.h
my_dir.h Fix for Bug #1952 2003-12-12 03:39:29 +03:00
my_getopt.h - Added missing documentation to some mysql.cc options. 2004-01-14 04:58:37 +02:00
my_global.h Fix of compilation failure of latest 4.1 tree: new constants in mysqld.cc 2004-03-15 22:39:36 +03:00
my_handler.h BTREE-indexes in HEAP tables can now be used to optimize ORDER BY 2004-03-25 15:05:01 +02:00
my_list.h
my_net.h 4 small items in this: 2003-10-31 23:20:23 +01:00
my_no_pthread.h CLIENT_MULTI_QUERIES -> CLIENT_MULTI_STATEMENTS 2003-11-18 13:47:27 +02:00
my_nosys.h
my_pthread.h Merge with 4.0.18 2004-02-11 00:06:46 +01:00
my_semaphore.h more #ifdef THREAD added 2003-04-30 12:32:43 +02:00
my_sys.h WL#775 "Add status variable identifying binlog_cache_size shortage" 2004-04-02 00:47:20 +04:00
my_tree.h after merge fixes 2004-03-18 00:09:13 +02:00
my_xml.h
myisam.h longer myisam keys 2004-02-20 20:38:34 +01:00
myisammrg.h
myisampack.h
mysql.h simple optimzation 2004-03-31 03:32:38 +03:00
mysql_com.h 1. New data types, from the user point of view: 2004-03-26 16:11:46 +04:00
mysql_embed.h SCRUM 2004-01-07 14:45:04 +04:00
mysql_version.h.in merge with 4.0 (to get compiler error fixes for innodb) 2004-03-19 15:17:56 +02:00
mysqld_error.h WL#1266 "Separate auto-set logic from TIMESTAMP type." 2004-04-02 10:12:53 +04:00
mysys_err.h - Added missing documentation to some mysql.cc options. 2004-01-14 04:58:37 +02:00
nisam.h
queues.h fix_max_connections to resize alarm_queue (Bug #1435) 2003-10-06 14:11:16 +02:00
raid.h
rijndael.h
sha1.h
sql_common.h Intermediate commit of client library (cleanups + fixes of 3 items from 2004-03-16 01:04:04 +03:00
sql_state.h WorkLog #1323 (part 2) 2003-12-17 22:52:03 +00:00
sslopt-case.h
sslopt-longopts.h consistency fix - all help texts for command-line options should end with a dot. 2003-06-13 10:59:02 +02:00
sslopt-vars.h
t_ctype.h
thr_alarm.h dummy resize_thr_alarm for Netware 2003-10-15 17:10:47 +02:00
thr_lock.h
typelib.h
violite.h Merge key cache structures to one 2003-11-20 22:06:25 +02:00