[MDEV-16542] Fix ALTER TABLE FORCE to upgrade temporal types Created: 2018-06-21  Updated: 2023-07-20  Resolved: 2018-07-09

Status: Closed
Project: MariaDB Server
Component/s: Data types, Temporal Types
Fix Version/s: 10.4.0

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-9967 Convert old temporal types on ALTER T... Closed
Relates
relates to MDEV-12574 MAX(old_decimal) produces a column of... Closed
relates to MDEV-15225 Can't import .ibd file with temporal ... Closed
relates to MDEV-19906 Show internal type for TIMESTAMP, DAT... Closed
relates to MDEV-15228 Document how to upgrade old temporal ... Closed
relates to MDEV-29754 Unexpected ER_NOT_FORM_FILE or ER_VER... Closed

 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.

Generated at Thu Feb 08 08:29:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.