Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-452

Add full support for auto-initialized/updated timestamp and datetime

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.1
    • None
    • None

    Description

      The task is to extract and backport all changes from MySQL 5.6 that move timestamp handling from the handler interface to the server.

      The change was done by:
      revno: 3402.50.105
      committer: Martin Hansson <martin.hansson@oracle.com>
      branch nick: mysql-wl5874-push
      timestamp: Tue 2012-01-31 16:16:16 +0100
      message:
      WL#5874: CURRENT_TIMESTAMP as DEFAULT for DATETIME columns.

      There is no public WL, however there is documentation:
      http://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html

      First goal is to evaluate MySQL's patch, whether it makes sense to backport it, or to reimplement it.
      Specifically check what are the changes to the FRM format, so that we can read MySQL 5.6 FRM files.

      Additional patches to investigate:
      Bug#11745578: 17392: ALTER TABLE ADD COLUMN TIMESTAMP
      DEFAULT CURRENT_TIMESTAMP INSERTS ZERO

      Possibly the following patch is related:
      committer: Martin Hansson <martin.hansson@oracle.com>
      branch nick: mysql-trunk-security
      timestamp: Thu 2012-02-09 13:33:22 +0100
      message:
      Merge of fix for Bug#11765810.

      In addition, MySQL 5.6.6 adds the following system variable, and corresponding change in behavior:
      http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp

      Since MySQL 5.6.6 is not Launchpad yet, it seems that the above is implemented by the following patches:

      Attachments

        Issue Links

          Activity

            Following Serg's advice, I reverted the change:
            http://bazaar.launchpad.net/~maria-captains/maria/5.5-serg/revision/2502.567.13
            Because MySQL fixed the problem in bug https://mariadb.atlassian.net/browse/MDEV-438
            (Microseconds: Precision is ignored in CURRENT_TIMESTAMP(N) when it is given as a default column value)
            in a different way. In order for MariaDB to be compatible with MySQL, and pass MySQL's regression tests,
            the above fix was removed.

            timour Timour Katchaounov (Inactive) added a comment - Following Serg's advice, I reverted the change: http://bazaar.launchpad.net/~maria-captains/maria/5.5-serg/revision/2502.567.13 Because MySQL fixed the problem in bug https://mariadb.atlassian.net/browse/MDEV-438 (Microseconds: Precision is ignored in CURRENT_TIMESTAMP(N) when it is given as a default column value) in a different way. In order for MariaDB to be compatible with MySQL, and pass MySQL's regression tests, the above fix was removed.

            Since this feature is reimplemented, because we thought that MySQL's implementation is both too complicated, and not efficient, it is quite interesting to compare the two implementations code wise.
            Since we didn't backport MySQL's unit tests, below I provide statistics of the MySQL patch without the unit tests. This makes both patches fully comparable via diffstat.

            MariaDB:

            • 61 files changed, 5376 insertions, 541 deletions
            • total new lines: 4835

            MySQL:

            • 59 files changed, 6916 insertions, 989 deletions
            • total new lines: 5927

            I plan to add some more comments, and do some more code cleanup, so the number above may change a bit, but not likely too much.

            timour Timour Katchaounov (Inactive) added a comment - Since this feature is reimplemented, because we thought that MySQL's implementation is both too complicated, and not efficient, it is quite interesting to compare the two implementations code wise. Since we didn't backport MySQL's unit tests, below I provide statistics of the MySQL patch without the unit tests. This makes both patches fully comparable via diffstat. MariaDB: 61 files changed, 5376 insertions , 541 deletions total new lines: 4835 MySQL: 59 files changed, 6916 insertions , 989 deletions total new lines: 5927 I plan to add some more comments, and do some more code cleanup, so the number above may change a bit, but not likely too much.

            Reassigned to Serg for review.
            The code is pushed to lp:~maria-captains/maria/10.0-mdev452.

            timour Timour Katchaounov (Inactive) added a comment - Reassigned to Serg for review. The code is pushed to lp:~maria-captains/maria/10.0-mdev452.

            This MySQL bug describes the problem with LOAD semantics wrt default functions/values:
            http://bugs.mysql.com/bug.php?id=14770

            timour Timour Katchaounov (Inactive) added a comment - This MySQL bug describes the problem with LOAD semantics wrt default functions/values: http://bugs.mysql.com/bug.php?id=14770

            Pushed to 10.0-base.

            timour Timour Katchaounov (Inactive) added a comment - Pushed to 10.0-base.

            People

              timour Timour Katchaounov (Inactive)
              timour Timour Katchaounov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.