Repository navigation
fix(plugins): restore MySQL zero dates and keep session settings - #3427
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
TablePro's MySQL dump set only the character set, unlike mysqldump. Under MySQL 8's default SQL mode its zero dates failed with 1292 (#3414), AUTO_INCREMENT 0 was renumbered and TIMESTAMPs shifted between time zones. Imports also left the file's settings on the editor's session.
Change
SQL_MODE,FOREIGN_KEY_CHECKSandTIME_ZONElines, are read in UTC under an empty SQL mode, and keep each routine, trigger and event's own SQL mode.search_pathincluded); MySQL to MySQL Object Copy and Transfer To keep zero dates, AUTO_INCREMENT 0 and TIMESTAMPs.postgresintervals and full float digits.Verified
scripts/probes/check-mysql-dump-session.shpasses on MariaDB 13.0.2 and MySQL 8.4.11 and fails on the old prologue;check-postgresql-dump-session.shpasses on PostgreSQL 17.11.SQLExportEncodingTestsbecameSQLExportSessionDeclarationTests.Not in this PR
SET SESSION sql_mode = 'NO_AUTO_VALUE_ON_ZERO'before import; no import option, by decision.DATEFORMAT.Fixes #3414