Skip to content

Commit 15214a4

Browse files
committed
MDEV-25708 THD::cleanup(): Assertion `!mdl_context.has_locks()' failed
The reason was that WSREP code in mysql_create_or_drop_trigge() did jump to an exit label that did not do proper cleanup of state. Fixed by ensuring that also WSREP code goes trough the cleanup process.
1 parent 2c90dc0 commit 15214a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sql/sql_trigger.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
457457
thd->variables.lock_wait_timeout))
458458
goto end;
459459

460-
461460
if (!create)
462461
{
463462
bool if_exists= thd->lex->if_exists();
@@ -565,7 +564,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
565564
#ifdef WITH_WSREP
566565
if (WSREP(thd) &&
567566
!wsrep_should_replicate_ddl(thd, table->s->db_type()->db_type))
568-
goto wsrep_error_label;
567+
goto end;
569568
#endif
570569

571570
/* Later on we will need it to downgrade the lock */
@@ -652,9 +651,11 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
652651
thd->mdl_context.release_lock(mdl_request_for_trn.ticket);
653652

654653
DBUG_RETURN(result);
654+
655655
#ifdef WITH_WSREP
656656
wsrep_error_label:
657-
DBUG_RETURN(true);
657+
DBUG_ASSERT(result == 1);
658+
goto end;
658659
#endif
659660
}
660661

0 commit comments

Comments
 (0)