1930
MariaDBERRORNotableReplicationHIGH confidence

Temporary tables exist; cannot switch to row-based logging

Production Risk

Medium — affects replication consistency; ensure temporary tables are cleaned up.

What this means

MySQL cannot switch the session binlog_format to ROW while temporary tables exist in the current session, because temporary table DDL cannot be replicated in row-based format.

Why it happens
  1. 1SET SESSION binlog_format = 'ROW' executed while the session has open temporary tables.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TEMPORARY TABLE tmp (id INT);
SET SESSION binlog_format = 'ROW'; -- error

expected output

ERROR 1930 (HY000): Temporary tables exist in the session; cannot switch to row-based logging.

Fix

Drop temporary tables before switching binlog format

Drop temporary tables before switching binlog format
DROP TEMPORARY TABLE IF EXISTS tmp;
SET SESSION binlog_format = 'ROW';

Why this works

Temporary tables must not exist when changing the session binlog format to ROW.

Sources
Official documentation ↗

MySQL 8.0 — 1930 ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR3

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

← All MariaDB errors