Commit 49a0ad69 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-23371: Crash in _db_doprnt_ via que_thr_step()

Something appears to be broken in the DBUG subsystem.
Let us remove frequent calls to it from the InnoDB internal SQL interpreter
that is used in the purge of transaction history.

The DBUG_PRINT in que_eval_sql() can remain for now, because those
operations are much less frequent.
parent 9ac8be4e
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2021, MariaDB Corporation. Copyright (c) 2017, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -402,17 +402,10 @@ que_graph_free_recursive( ...@@ -402,17 +402,10 @@ que_graph_free_recursive(
ind_node_t* cre_ind; ind_node_t* cre_ind;
purge_node_t* purge; purge_node_t* purge;
DBUG_ENTER("que_graph_free_recursive");
if (node == NULL) { if (node == NULL) {
return;
DBUG_VOID_RETURN;
} }
DBUG_PRINT("que_graph_free_recursive",
("node: %p, type: " ULINTPF, node,
que_node_get_type(node)));
switch (que_node_get_type(node)) { switch (que_node_get_type(node)) {
case QUE_NODE_FORK: case QUE_NODE_FORK:
...@@ -558,8 +551,6 @@ que_graph_free_recursive( ...@@ -558,8 +551,6 @@ que_graph_free_recursive(
default: default:
ut_error; ut_error;
} }
DBUG_VOID_RETURN;
} }
/**********************************************************************//** /**********************************************************************//**
...@@ -892,65 +883,6 @@ que_node_get_containing_loop_node( ...@@ -892,65 +883,6 @@ que_node_get_containing_loop_node(
return(node); return(node);
} }
#ifndef DBUG_OFF
/** Gets information of an SQL query graph node.
@return type description */
static MY_ATTRIBUTE((warn_unused_result, nonnull))
const char*
que_node_type_string(
/*=================*/
const que_node_t* node) /*!< in: query graph node */
{
switch (que_node_get_type(node)) {
case QUE_NODE_SELECT:
return("SELECT");
case QUE_NODE_INSERT:
return("INSERT");
case QUE_NODE_UPDATE:
return("UPDATE");
case QUE_NODE_WHILE:
return("WHILE");
case QUE_NODE_ASSIGNMENT:
return("ASSIGNMENT");
case QUE_NODE_IF:
return("IF");
case QUE_NODE_FETCH:
return("FETCH");
case QUE_NODE_OPEN:
return("OPEN");
case QUE_NODE_PROC:
return("STORED PROCEDURE");
case QUE_NODE_FUNC:
return("FUNCTION");
case QUE_NODE_LOCK:
return("LOCK");
case QUE_NODE_THR:
return("QUERY THREAD");
case QUE_NODE_COMMIT:
return("COMMIT");
case QUE_NODE_UNDO:
return("UNDO ROW");
case QUE_NODE_PURGE:
return("PURGE ROW");
case QUE_NODE_ROLLBACK:
return("ROLLBACK");
case QUE_NODE_CREATE_TABLE:
return("CREATE TABLE");
case QUE_NODE_CREATE_INDEX:
return("CREATE INDEX");
case QUE_NODE_FOR:
return("FOR LOOP");
case QUE_NODE_RETURN:
return("RETURN");
case QUE_NODE_EXIT:
return("EXIT");
default:
ut_ad(0);
return("UNKNOWN NODE TYPE");
}
}
#endif /* !DBUG_OFF */
/**********************************************************************//** /**********************************************************************//**
Performs an execution step on a query thread. Performs an execution step on a query thread.
@return query thread to run next: it may differ from the input @return query thread to run next: it may differ from the input
...@@ -978,10 +910,6 @@ que_thr_step( ...@@ -978,10 +910,6 @@ que_thr_step(
old_thr = thr; old_thr = thr;
DBUG_PRINT("ib_que", ("Execute %u (%s) at %p",
unsigned(type), que_node_type_string(node),
(const void*) node));
if (type & QUE_NODE_CONTROL_STAT) { if (type & QUE_NODE_CONTROL_STAT) {
if ((thr->prev_node != que_node_get_parent(node)) if ((thr->prev_node != que_node_get_parent(node))
&& que_node_get_next(thr->prev_node)) { && que_node_get_next(thr->prev_node)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment