correct logic for database backup use of single-transaction #14925
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.
Description
The recent release of 4.9.0 and 5.1.0 has a bug which makes MySQL backups fail. Because in this commit, the logic of when to use
--single-transaction
was reversed.97da6ca#diff-83d39a4592b31403e3830a3100e22c596322d8dd9a240e07f6ecf173ec1d7bb7
Breaking change in detail
Before the commit if mysql version is newer than 5.7.41 or 8.0.32 results in FALSE
After the commit if mysql version is newer than 5.7.41 or 8.0.32 results in TRUE
Why do we even check MySQL versions?
This check is done because after those versions, mysqldump will require the FLUSH TABLES privileges to run, which shared hosting usually will not give, as it is considered system privileges. Thus breaking any use of mysqldump. (See #12557)
Related issues
This fixes: #14922