The statement cannot be written to the binary log as a single event while GTID_NEXT is set to a specific UUID:NUMBER, so MySQL refuses to execute it.
MySQL error 1884 ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP appears when a statement that must be split into multiple binlog records runs while @@SESSION.GTID_NEXT is fixed to a UUID:NUMBER. Switch GTID_NEXT back to AUTOMATIC or break the statement apart to resolve the issue.
ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP
Error 1884 ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP is returned when MySQL must break a single SQL command into multiple binary log events, but the session has fixed @@SESSION.GTID_NEXT to a literal UUID:NUMBER value.
GTID replication expects each GTID group to correspond to one transaction in the binlog. Statements that internally generate more than one binlog event, such as CREATE TABLE ... SELECT, violate that rule. MySQL therefore aborts the statement instead of risking replication inconsistency.
The error arises in GTID-enabled servers (5.7.5+) when users manually set GTID_NEXT to assign a specific GTID to the next transaction. If the upcoming statement requires splitting, MySQL cannot guarantee a one-to-one mapping between the chosen GTID and the multiple events, so it aborts.
Typical situations include online schema changes, bulk inserts using SELECT, or DDL that creates both table metadata and data rows in the same command.
Leaving sessions stuck with GTID_NEXT set risks blocking further work, breaking automation scripts, and halting replication pipelines. Resolving the setting or rewriting the statement ensures consistent GTID sequences across masters and replicas.
Developers running SET GTID_NEXT='UUID:NUMBER' to replay or skip a transaction frequently encounter the error when they later execute a multi-event statement.
This compound command writes DDL and DML in one logical unit, producing multiple binlog events that cannot share the single GTID you assigned.
Copy-based ALTER operations copy rows into a new table then swap it in, generating several binlog events that need different GTIDs.
Complex updates that cascade foreign-key actions can also expand into multiple binlog events, triggering the same error under a fixed GTID_NEXT.
Occurs when mixing transactional and non-transactional tables inside one GTID transaction.
Raised when attempting to set GTID_NEXT while GTID mode is disabled on the server.
Appears if GTID_NEXT is UUID:NUMBER and you start a transaction without committing, leaving the group undefined.
No - MySQL prevents execution to protect replication integrity. You must change GTID_NEXT or rewrite the statement.
Not for this error. The issue is the need for multiple GTIDs, not the row or statement format.
Disabling binary logging breaks replication and point-in-time recovery. Use only in isolated environments.
Galaxy’s editor displays session variables and warns when GTID_NEXT is set. Its AI copilot offers one-click fixes like resetting to AUTOMATIC before running multi-event commands.