mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
bc4a456758
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.
18 lines
478 B
Text
18 lines
478 B
Text
--echo #
|
|
--echo # Test of function defaults for non-embedded server.
|
|
--echo #
|
|
|
|
--source include/not_embedded.inc
|
|
--source include/have_debug_sync.inc
|
|
|
|
--echo #
|
|
--echo # Function defaults run 1. No microsecond precision.
|
|
--echo #
|
|
let $timestamp=TIMESTAMP;
|
|
--source include/function_defaults_notembedded.inc
|
|
|
|
--echo #
|
|
--echo # Function defaults run 2. Six digits scale on seconds precision.
|
|
--echo #
|
|
let $timestamp=TIMESTAMP(6);
|
|
--source include/function_defaults_notembedded.inc
|