Bug #104153 | CREATE...SELECT statements break replication when ANSI mode is enabled | ||
---|---|---|---|
Submitted: | 29 Jun 2021 14:34 | Modified: | 1 Sep 2021 21:29 |
Reporter: | Kevin Michel (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 8.0.21, 8.0.25 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | regression |
[29 Jun 2021 14:34]
Kevin Michel
[29 Jun 2021 14:36]
Kevin Michel
GitHub PR is #347
[30 Jun 2021 12:52]
MySQL Verification Team
Hello Kevin Michel, Thank you for the report and feedback. Verified as described with 8.0.25 build. regards, Umesh
[8 Jul 2021 13:38]
OCA Admin
Contribution submitted via Github - #104153 Fix CREATE...SELECT row-based binlog in ANSI mode (*) Contribution by Kevin Michel (Github kmichel-aiven, mysql-server/pull/347#issuecomment-876297952): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: git_patch_680070222.txt (text/plain), 5.95 KiB.
[1 Sep 2021 21:29]
Christine Cole
Posted by developer: Fixed as of the upcoming MySQL 8.0.27 release, and here's the proposed changelog entry from the documentation team: A statement such as CREATE TABLE t SELECT 1; created an InnoDB table that was written incorrectly to the binary log if the value of binlog_format was set to ROW and sql_mode was in ANSI mode. As a result, replication of the statement failed with an error on the replica. Applying the mysqlbinlog utility to such a binary log could also fail. The atomic CREATE...SELECT was implemented by adding a new clause to the CREATE TABLE called START TRANSACTION. However, this clause was NOT added when ANSI mode was enabled. This in turn caused the execution of an ordinary implicit-committing CREATE TABLE in the middle of the transaction and produced an error in GTID mode if the transaction had an assigned GTID. The issue is fixed by removing the SQL-mode dependency from the new clause. Thank you for the bug report.