summaryrefslogtreecommitdiff
path: root/sql/sql_base.h
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2012-10-17 15:43:56 +0300
committerunknown <timour@askmonty.org>2012-10-17 15:43:56 +0300
commitbc4a456758c8077e5377b8cfaed60af4311653a0 (patch)
treeb4689bc3028c30ad38355adbb4d574db5cb57437 /sql/sql_base.h
parent620d14f8c3521f9ec7283b8690e0e16434739d33 (diff)
downloadmariadb-git-bc4a456758c8077e5377b8cfaed60af4311653a0.tar.gz
MDEV-452 Add full support for auto-initialized/updated timestamp and datetime
Generalized support for auto-updated and/or auto-initialized timestamp and datetime columns. This patch is a reimplementation of MySQL's "WL#5874: CURRENT_TIMESTAMP as DEFAULT for DATETIME columns". In order to ease future merges, this implementation reused few function and variable names from MySQL's patch, however the implementation is quite different. TODO: The only unresolved problem in this patch is the semantics of LOAD DATA for TIMESTAMP and DATETIME columns in the cases when there are missing or NULL columns. I couldn't fully comprehend the logic behind MySQL's behavior and its relationship with their own documentation, so I left the results to be more consistent with all other LOAD cases. The problematic test cases can be seen by running the test file function_defaults, and observing the test case differences. Those were left on purpose for discussion.
Diffstat (limited to 'sql/sql_base.h')
-rw-r--r--sql/sql_base.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_base.h b/sql/sql_base.h
index 3deb97c9730..fbe905375bb 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -170,15 +170,15 @@ TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl);
TABLE *find_temporary_table(THD *thd, const char *table_key,
uint table_key_length);
void close_thread_tables(THD *thd);
-bool fill_record_n_invoke_before_triggers(THD *thd, List<Item> &fields,
+bool fill_record_n_invoke_before_triggers(THD *thd, TABLE *table,
+ List<Item> &fields,
List<Item> &values,
bool ignore_errors,
- Table_triggers_list *triggers,
enum trg_event_type event);
-bool fill_record_n_invoke_before_triggers(THD *thd, Field **field,
+bool fill_record_n_invoke_before_triggers(THD *thd, TABLE *table,
+ Field **field,
List<Item> &values,
bool ignore_errors,
- Table_triggers_list *triggers,
enum trg_event_type event);
bool insert_fields(THD *thd, Name_resolution_context *context,
const char *db_name, const char *table_name,
@@ -191,7 +191,7 @@ bool setup_fields(THD *thd, Item** ref_pointer_array,
List<Item> &item, enum_mark_columns mark_used_columns,
List<Item> *sum_func_list, bool allow_sum_func);
void unfix_fields(List<Item> &items);
-bool fill_record(THD *thd, Field **field, List<Item> &values,
+bool fill_record(THD *thd, TABLE *table, Field **field, List<Item> &values,
bool ignore_errors, bool use_value);
Field *
@@ -304,6 +304,7 @@ TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db,
void mark_tmp_table_for_reuse(TABLE *table);
bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists);
int update_virtual_fields(THD *thd, TABLE *table, bool ignore_stored= FALSE);
+int update_default_fields(TABLE *table);
int dynamic_column_error_message(enum_dyncol_func_result rc);
extern TABLE *unused_tables;