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

Change default of explicit_defaults_for_timestamp to ON

Details

    Description

      Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values https://mariadb.com/kb/en/timestamp/#automatic-values

      explicit_defaults_for_timestamp , currently set to OFF by default, should be ON by default.

      At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

      In effect:
      With explicit_defaults_for_timestamp=OFF (default):

      MariaDB> CREATE TABLE t1 (a timestamp);
      MariaDB> SHOW CREATE TABLE t1;
       
      CREATE TABLE `t1` (
        `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
      ) ...

      With explicit_defaults_for_timestamp=ON the result would be:

      CREATE TABLE `t1` (
        `a` timestamp NULL DEFAULT NULL
      ) ...

      MySQL did it in 8.0.2

      Attachments

        Issue Links

          Activity

            ralf.gebhardt Ralf Gebhardt created issue -
            ralf.gebhardt Ralf Gebhardt made changes -
            Field Original Value New Value
            ralf.gebhardt Ralf Gebhardt made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 10.10 [ 27530 ]
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Status Stalled [ 10000 ] In Testing [ 10301 ]
            monty Michael Widenius made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.



            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            <<sql>>
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            <</sql>>

            With explicit_defaults_for_timestamp=ON the result would be:
            <<sql>
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            <</sql>>
            monty Michael Widenius made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            <<sql>>
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            <</sql>>

            With explicit_defaults_for_timestamp=ON the result would be:
            <<sql>
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            <</sql>>
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {sql}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {sql}

            With explicit_defaults_for_timestamp=ON the result would be:
            <<sql>
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            <</sql>>
            monty Michael Widenius made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {sql}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {sql}

            With explicit_defaults_for_timestamp=ON the result would be:
            <<sql>
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            <</sql>>
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {quote}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {quote}

            With explicit_defaults_for_timestamp=ON the result would be:
            <<sql>
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            <</sql>>
            monty Michael Widenius made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {quote}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {quote}

            With explicit_defaults_for_timestamp=ON the result would be:
            <<sql>
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            <</sql>>
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {monospace}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {monospace}

            With explicit_defaults_for_timestamp=ON the result would be:
            {monospace}
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {monospace}
            monty Michael Widenius made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {monospace}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {monospace}

            With explicit_defaults_for_timestamp=ON the result would be:
            {monospace}
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {monospace}
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {{monospaced}}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {{monospaced}}

            With explicit_defaults_for_timestamp=ON the result would be:
            {{monospaced}}
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {{monospaced}}
            monty Michael Widenius made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {{monospaced}}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {{monospaced}}

            With explicit_defaults_for_timestamp=ON the result would be:
            {{monospaced}}
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            {{monospaced}}
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {{
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            }}

            With explicit_defaults_for_timestamp=ON the result would be:
            {{
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            }}
            monty Michael Widenius made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {{
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            }}

            With explicit_defaults_for_timestamp=ON the result would be:
            {{
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            }}
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1

            With explicit_defaults_for_timestamp=ON the result would be:

            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            monty Michael Widenius made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1

            With explicit_defaults_for_timestamp=ON the result would be:

            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ...
            With explicit_defaults_for_timestamp=ON the result would be:

            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ...
            serg Sergei Golubchik made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ...
            With explicit_defaults_for_timestamp=ON the result would be:

            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ...
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {code:sql}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ...
            {code}
            With explicit_defaults_for_timestamp=ON the result would be:
            {code:sql}
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ...
            {code}
            serg Sergei Golubchik made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values
            https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {code:sql}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ...
            {code}
            With explicit_defaults_for_timestamp=ON the result would be:
            {code:sql}
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ...
            {code}
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {code:sql}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ...
            {code}
            With explicit_defaults_for_timestamp=ON the result would be:
            {code:sql}
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ...
            {code}

            MySQL did it in 8.0.2
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Lena Startseva [ JIRAUSER50478 ]
            elenst Elena Stepanova made changes -
            Assignee Lena Startseva [ JIRAUSER50478 ] Elena Stepanova [ elenst ]
            elenst Elena Stepanova made changes -
            serg Sergei Golubchik made changes -
            Assignee Elena Stepanova [ elenst ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            serg Sergei Golubchik made changes -
            Status Stalled [ 10000 ] In Testing [ 10301 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Elena Stepanova [ elenst ]
            serg Sergei Golubchik made changes -
            Assignee Elena Stepanova [ elenst ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Status Stalled [ 10000 ] In Testing [ 10301 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Elena Stepanova [ elenst ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Comment [ [~elenst], I've pushed everything into bb-10.10-MDEV-28632 branch. But after everything is ok, I'll cherry-pick commits "make @@explicit_defaults_for_timestamp session variable" and "save it in binlog, so that CREATE TABLE could be replayed correctly on the slave" to 10.3 ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            elenst Elena Stepanova made changes -
            Assignee Elena Stepanova [ elenst ] Sergei Golubchik [ serg ]
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Priority Critical [ 2 ] Blocker [ 1 ]
            AirFocus AirFocus made changes -
            Description Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values https://mariadb.com/kb/en/timestamp/#automatic-values

            *explicit_defaults_for_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for_timestamp=OFF (default):
            {code:sql}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ...
            {code}
            With explicit_defaults_for_timestamp=ON the result would be:
            {code:sql}
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ...
            {code}

            MySQL did it in 8.0.2
            Users new to MariaDB often struggle with the default behavior of MariaDB regarding the datatype timestamp and automatic values https://mariadb.com/kb/en/timestamp/#automatic\-values

            *explicit_defaults_for\_timestamp* , currently set to OFF by default, should be ON by default.

            At the same time it should be checked if the variable can become a dynamic variable and if the scope SESSION can be added.

            In effect:
            With explicit_defaults_for\_timestamp=OFF (default):

            {code:sql}
            MariaDB> CREATE TABLE t1 (a timestamp);
            MariaDB> SHOW CREATE TABLE t1;

            CREATE TABLE `t1` (
              `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
            ) ...
            {code}

            With explicit_defaults_for\_timestamp=ON the result would be:

            {code:sql}
            CREATE TABLE `t1` (
              `a` timestamp NULL DEFAULT NULL
            ) ...
            {code}

            MySQL did it in 8.0.2
            serg Sergei Golubchik made changes -
            Fix Version/s 10.10.1 [ 27913 ]
            Fix Version/s 10.10 [ 27530 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            elenst Elena Stepanova made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Labels incompatibility Preview_10.10 incompatibility

            People

              serg Sergei Golubchik
              ralf.gebhardt Ralf Gebhardt
              Votes:
              3 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.