1600
MariaDBERRORNotableReplicationHIGH confidence

Temporary table prevents switching out of row-based replication (session-level)

Production Risk

Low — the SET is blocked; no data is lost.

What this means

Session-level variant: cannot change binlog_format away from ROW while a temporary table is open in the current session.

Why it happens
  1. 1A temporary table is open in the session when SET SESSION binlog_format is issued.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TEMPORARY TABLE tmp (id INT);
SET SESSION binlog_format = 'STATEMENT';

expected output

ERROR 1600 (HY000): Cannot change the binlog direct flag when a temporary table is open

Fix

Close the temporary table first

Close the temporary table first
DROP TEMPORARY TABLE IF EXISTS tmp;
SET SESSION binlog_format = 'STATEMENT';

Why this works

Close all temporary tables before changing the session-level binlog_format.

Version notes

Sources
Official documentation ↗

MySQL 8.0 — 1600 ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR

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

← All MariaDB errors