Details
-
Bug
-
Status: In Review (View Workflow)
-
Critical
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.1, 13.2
Description
DML_prelocking_strategy::handle_table() and prepare_fk_prelocking_list() in sql/sql_base.cc start with DBUG_ENTER, but three of their error exits return with a plain return TRUE;. In a debug build, taking any of them aborts the server at the next DBUG_RETURN up the stack:
mariadbd: debugger aborting because missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "handle_table"
|
The three exits, as on main:
// DML_prelocking_strategy::handle_table()
|
if (table_list->trg_event_map && trigger_prelocking_needed) |
{
|
if (table->triggers) |
{
|
*need_prelocking= TRUE;
|
|
|
if (table->triggers-> |
add_tables_and_routines_for_triggers(thd, prelocking_ctx, table_list))
|
return TRUE; |
}
|
|
|
if (prepare_fk_prelocking_list(thd, prelocking_ctx, table_list, |
need_prelocking,
|
table_list->trg_event_map))
|
return TRUE; |
}
|
// prepare_fk_prelocking_list()
|
table->file->get_parent_foreign_key_list(thd, &fk_list);
|
if (unlikely(thd->is_error())) |
{
|
if (arena) |
thd->restore_active_arena(arena, &backup);
|
return TRUE; |
}
|
MDEV-31680 is this abort in prepare_fk_prelocking_list, reached from handle_table. It was reproducible on 10.4 to 11.0, and was closed as Cannot Reproduce because its test case no longer gets to this code. Its test case still passes on main. The exits are unchanged on 10.11, 11.4, 11.8, 12.3, 13.1 and main.
The exits are reached as follows:
- The second exit in handle_table, together with the one in prepare_fk_prelocking_list, is reached when get_parent_foreign_key_list() leaves an error in the diagnostics area.
- The second exit in handle_table alone is also reached in a WSREP build when wsrep_foreign_key_append() fails. prepare_fk_prelocking_list returns through DBUG_RETURN(error) on that path.
- The first exit in handle_table cannot be reached at present, since Table_triggers_list::add_tables_and_routines_for_triggers() has no path that returns TRUE.
Release builds are not affected: DBUG_ENTER and DBUG_RETURN compile to nothing there.
Attachments
Issue Links
- relates to
-
MDEV-31680 Missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "prepare_fk_prelocking_list"
-
- Closed
-
-
MDEV-41218 AFTER ... BEFORE COMMIT [OR SAVEPOINT] and AFTER ... FOR EACH STATEMENT triggers
-
- Open
-
-
MDEV-41538 A stored procedure statement whose foreign key prelocking failed once never locks the referencing tables again
-
- In Review
-
-
MDEV-41539 Server crashes in prepare_fk_prelocking_list() when allocating a TABLE_LIST for a referencing table fails
-
- In Review
-