3075
MySQLERRORNotableReplicationHIGH confidence

Cannot change binlog_direct_non_transactional_updates inside a transaction

Production Risk

Medium — the current transaction may be left in an unintended state.

What this means

The binlog_direct_non_transactional_updates variable cannot be changed inside an open transaction.

Why it happens
  1. 1Attempting SET SESSION binlog_direct_non_transactional_updates while a transaction is open.
How to reproduce
trigger — this will error
trigger — this will error
START TRANSACTION;
SET SESSION binlog_direct_non_transactional_updates = ON;

expected output

ERROR 3075 (HY000): Cannot change the binlog_direct_non_transactional_updates inside a transaction.

Fix

Commit or rollback the transaction first

Commit or rollback the transaction first
COMMIT;
SET SESSION binlog_direct_non_transactional_updates = ON;

Why this works

Ensures the variable is changed outside of any transaction context.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3075 ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT2

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors