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

Fix ALTER TABLE FORCE to upgrade temporal types

    XMLWordPrintable

    Details

      Description

      Currently there is no an easy way to convert on upgrade old TIME, DATETIME, TIMESTAMP (handled by Field_time, Field_datetime, Field_timestamp) columns to new columns (handled by Field_timef, Field_datetimef, Field_timestampf).

      Conversion is necessary in some scenarios:

      • To import InnoDB table spaces
      • For replication purposes (as old temporal formats did not replicate fractional second precision in the data type metadata)

      Possible conversion options:

      • dump followed by restore
      • "ALTER TABLE t1 MODIFY time_column TIME", i.e. using MODIFY with "same" data type.

      Both ways are not convenient.

      We'll fix ALTER TABLE t1 FORCE to replace old temporal columns according to the current @@mysql56_temporal_format settings:

      • If @@mysql56_temporal_format is true, all TIME, DATETIME, TIMESTAMP columns will be replaced to the new format.
      • If @@mysql56_temporal_format is false, all TIME, DATETIME, TIMESTAMP columns will be replaced to the old format.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: