You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MDEV-36484 Atomic DDL: Assertion `!param->got_error' failed upon unsuccessful multi-RENAME TABLE
When executing an atomic sequence of RENAME operations, such as:
RENAME TABLE t1 TO t2, t3 TO t4, ...
any failure in the sequence triggers a rollback of previously completed
renames to preserve atomicity.
However, when an error occurs, `my_error()` is invoked immediately, which
sets the `thd->is_error()` flag. This premature flag setting causes
the rollback logic to misinterpret the thread state, leading to incorrect
reversion behavior and assertion failures.
To address this, the error is now captured and deferred — stored during
the failure and only passed to `my_error()` after the DDL reversion
is complete. This ensures the error state is not prematurely set, allowing
the rollback logic to execute safely and correctly.
Copy file name to clipboardExpand all lines: mysql-test/main/rename.result
+16
Original file line number
Diff line number
Diff line change
@@ -175,3 +175,19 @@ drop table t2;
175
175
rename table if exists t1 to t2;
176
176
alter table if exists t2 rename to t1;
177
177
drop table t1;
178
+
#
179
+
# MDEV-36484 Atomic DDL: Assertion `!param->got_error' failed upon
180
+
# unsuccessful multi-RENAME TABLE
181
+
#
182
+
CREATE TABLE t1 (a INT);
183
+
CREATE TRIGGER t1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (0);
184
+
RENAME TABLE t1 TO t2, t3 TO t4;
185
+
ERROR 42S02: Table 'test.t3' doesn't exist
186
+
SHOW CREATE TRIGGER t1;
187
+
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created
188
+
t1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1 AFTER INSERT ON `t1` FOR EACH ROW INSERT INTO t1 VALUES (0) latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci #
189
+
RENAME TABLE t1 TO t2;
190
+
SHOW CREATE TRIGGER t1;
191
+
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created
192
+
t1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1 AFTER INSERT ON `t2` FOR EACH ROW INSERT INTO t1 VALUES (0) latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci #
0 commit comments