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

Show internal type for TIMESTAMP, DATETIME, and TIME columns

Details

    Description

      MySQL 5.6 and later supports the show_old_temporals system variable that configures the server to show internal type for TIMESTAMP, DATETIME, and TIME columns:

      show_old_temporals

      Property Value
      Command-Line Format --show-old-temporals[=

      Unknown macro: {OFF|ON}

      ]
      Introduced 5.6.24
      Deprecated 5.6.24
      System Variable show_old_temporals
      Scope Global, Session
      Dynamic Yes
      Type Boolean
      Default Value OFF

      Whether SHOW CREATE TABLE output includes comments to flag temporal columns found to be in pre-5.6.4 format (TIME, DATETIME, and TIMESTAMP columns without support for fractional seconds precision). This variable is disabled by default. If enabled, SHOW CREATE TABLE output looks like this:

      CREATE TABLE `mytbl` (
      `ts` timestamp /* 5.5 binary format */ NOT NULL DEFAULT CURRENT_TIMESTAMP,
      `dt` datetime /* 5.5 binary format */ DEFAULT NULL,
      `t` time /* 5.5 binary format */ DEFAULT NULL
      ) DEFAULT CHARSET=latin1
      Output for the COLUMN_TYPE column of the INFORMATION_SCHEMA.COLUMNS table is affected similarly.

      This variable was added in MySQL 5.6.24. It is deprecated and will be removed in a future MySQL release.

      https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_show_old_temporals

      Mixing old temporal types and new temporal types can cause a lot of issues with replication and with importing InnoDB tablespaces. It would be useful to have some easy way tell if a temporal column uses the MariaDB 5.3 format or the MySQL 5.6 format or the pre-MySQL 5.6 format. We should probably port this feature from MySQL, or re-implement a similar feature.

      Attachments

        Issue Links

          Activity

            GeoffMontee Geoff Montee (Inactive) created issue -
            GeoffMontee Geoff Montee (Inactive) made changes -
            Field Original Value New Value
            GeoffMontee Geoff Montee (Inactive) made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            julien.fritsch Julien Fritsch made changes -
            Affects Version/s 10.1.40 [ 23306 ]
            Affects Version/s 10.2.25 [ 23408 ]
            Affects Version/s 10.3.16 [ 23410 ]
            Affects Version/s 10.4.6 [ 23412 ]
            Issue Type New Feature [ 2 ] Task [ 3 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Alexander Barkov [ bar ]
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2020-01-17 07:48:38.0 2020-01-17 07:48:38.082
            bar Alexander Barkov made changes -
            Fix Version/s 10.5.1 [ 24029 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            GeoffMontee Geoff Montee (Inactive) made changes -
            Summary Port show_old_temporals from MySQL 5.6 Show internal type for TIMESTAMP, DATETIME, and TIME columns
            GeoffMontee Geoff Montee (Inactive) made changes -
            Description I think it would be useful to port the {{show_old_temporals}} system variable from MySQL 5.6:

            {quote}
            show_old_temporals

            Property Value
            Command-Line Format --show-old-temporals[={OFF|ON}]
            Introduced 5.6.24
            Deprecated 5.6.24
            System Variable show_old_temporals
            Scope Global, Session
            Dynamic Yes
            Type Boolean
            Default Value OFF

            Whether SHOW CREATE TABLE output includes comments to flag temporal columns found to be in pre-5.6.4 format (TIME, DATETIME, and TIMESTAMP columns without support for fractional seconds precision). This variable is disabled by default. If enabled, SHOW CREATE TABLE output looks like this:

            CREATE TABLE `mytbl` (
              `ts` timestamp /* 5.5 binary format */ NOT NULL DEFAULT CURRENT_TIMESTAMP,
              `dt` datetime /* 5.5 binary format */ DEFAULT NULL,
              `t` time /* 5.5 binary format */ DEFAULT NULL
            ) DEFAULT CHARSET=latin1
            Output for the COLUMN_TYPE column of the INFORMATION_SCHEMA.COLUMNS table is affected similarly.

            This variable was added in MySQL 5.6.24. It is deprecated and will be removed in a future MySQL release.
            {quote}

            https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_show_old_temporals

            Mixing old temporal types and new temporal types can cause a lot of issues with replication and with importing InnoDB tablespaces. It would be useful to have some easy way tell if a temporal column uses the MariaDB 5.3 format or the MySQL 5.6 format or the pre-MySQL 5.6 format.
            MySQL 5.6 and later supports the {{show_old_temporals}} system variable that configures the server to show internal type for {{TIMESTAMP}}, {{DATETIME}}, and {{TIME}} columns:

            {quote}
            show_old_temporals

            Property Value
            Command-Line Format --show-old-temporals[={OFF|ON}]
            Introduced 5.6.24
            Deprecated 5.6.24
            System Variable show_old_temporals
            Scope Global, Session
            Dynamic Yes
            Type Boolean
            Default Value OFF

            Whether SHOW CREATE TABLE output includes comments to flag temporal columns found to be in pre-5.6.4 format (TIME, DATETIME, and TIMESTAMP columns without support for fractional seconds precision). This variable is disabled by default. If enabled, SHOW CREATE TABLE output looks like this:

            CREATE TABLE `mytbl` (
              `ts` timestamp /* 5.5 binary format */ NOT NULL DEFAULT CURRENT_TIMESTAMP,
              `dt` datetime /* 5.5 binary format */ DEFAULT NULL,
              `t` time /* 5.5 binary format */ DEFAULT NULL
            ) DEFAULT CHARSET=latin1
            Output for the COLUMN_TYPE column of the INFORMATION_SCHEMA.COLUMNS table is affected similarly.

            This variable was added in MySQL 5.6.24. It is deprecated and will be removed in a future MySQL release.
            {quote}

            https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_show_old_temporals

            Mixing old temporal types and new temporal types can cause a lot of issues with replication and with importing InnoDB tablespaces. It would be useful to have some easy way tell if a temporal column uses the MariaDB 5.3 format or the MySQL 5.6 format or the pre-MySQL 5.6 format. We should probably port this feature from MySQL, or re-implement a similar feature.
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            Labels ServiceNow
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            Labels ServiceNow 76qDvLB8Gju6Hs7nk3VY3EX42G795W5z
            serg Sergei Golubchik made changes -
            Labels 76qDvLB8Gju6Hs7nk3VY3EX42G795W5z
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 97861 ] MariaDB v4 [ 134020 ]
            danblack Daniel Black made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 201658 120960 201896 106948
            Zendesk active tickets 201658 201896
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk active tickets 201658 201896 201896

            People

              bar Alexander Barkov
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.