diff options
author | unknown <timour@askmonty.org> | 2012-10-17 15:43:56 +0300 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2012-10-17 15:43:56 +0300 |
commit | bc4a456758c8077e5377b8cfaed60af4311653a0 (patch) | |
tree | b4689bc3028c30ad38355adbb4d574db5cb57437 /sql/sp_head.cc | |
parent | 620d14f8c3521f9ec7283b8690e0e16434739d33 (diff) | |
download | mariadb-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/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index f3ba0073c69..11f962dd414 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -2426,7 +2426,6 @@ sp_head::fill_field_definition(THD *thd, LEX *lex, { LEX_STRING cmt = { 0, 0 }; uint unused1= 0; - int unused2= 0; if (field_def->init(thd, (char*) "", field_type, lex->length, lex->dec, lex->type, (Item*) 0, (Item*) 0, &cmt, 0, @@ -2443,8 +2442,7 @@ sp_head::fill_field_definition(THD *thd, LEX *lex, sp_prepare_create_field(thd, field_def); - if (prepare_create_field(field_def, &unused1, &unused2, &unused2, - HA_CAN_GEOMETRY)) + if (prepare_create_field(field_def, &unused1, HA_CAN_GEOMETRY)) { return TRUE; } |