Skip to content

dump DEFAULT CURRENT_TIMESTAMP columns on MySQL 8 - #559

Open
jayhemnani9910 wants to merge 1 commit into
databacker:mainfrom
jayhemnani9910:fix/keep-default-generated-columns
Open

jayhemnani9910 wants to merge 1 commit into
databacker:mainfrom
jayhemnani9910:fix/keep-default-generated-columns

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

On MySQL 8, SHOW COLUMNS marks any column with an expression default as DEFAULT_GENERATED, e.g. created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP. The filter that skips generated columns (#258) matched any Extra value containing GENERATED, so those columns were left out of the dump, and a restore set every row's created_at/updated_at to the time of the restore.

Only VIRTUAL GENERATED, STORED GENERATED and MariaDB's PERSISTENT columns are skipped now.

Added a test for the Extra values. Checked against MySQL 8.4: the dump now has the timestamp columns, a stored generated column is still left out, and after a restore the rows keep their original timestamps.

Signed-off-by: Jay Hemnani <193022578+jayhemnani9910@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant