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

TIMESTAMP logic remains partly non-standard with explicit_defaults_for_timestamp

    XMLWordPrintable

    Details

      Description

      Note: Even though this is an old known issue not specific to 10.10, I think it becomes much more important now when MDEV-28632 is about to be pushed into 10.10 main; so I'm marking it as 10.10V1 against the standard procedure. Please feel free to adjust both the marking and the priority after deciding what to do about it.

      With explicit_defaults_for_timestamp, if a TIMESTAMP column is defined as NOT NULL without a default value, it still partially retains an implicit (only undeclared) logic and gets a current timestamp value if NULL is attempted to be inserted.

      Run with --mysqld=--explicit-defaults-for-timestamp=on

      CREATE TABLE t (a TIMESTAMP NOT NULL);
      SHOW CREATE TABLE t;
       
      INSERT INTO t VALUES (NULL);
      SELECT * FROM t;
       
      # Cleanup
      DROP TABLE t;
      

      10.3 efdbb3cf

      CREATE TABLE t (a TIMESTAMP NOT NULL);
      SHOW CREATE TABLE t;
      Table	Create Table
      t	CREATE TABLE `t` (
        `a` timestamp NOT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1
      INSERT INTO t VALUES (NULL);
      SELECT * FROM t;
      a
      2022-06-30 00:34:21
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration

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