diff options
author | unknown <monty@hundin.mysql.fi> | 2002-01-30 16:37:47 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-01-30 16:37:47 +0200 |
commit | 963ea1ae0ac9d5b837d8ff35276ef34afa075295 (patch) | |
tree | 3ca7f6fddbb9bdc0b635f243af69c6606924c3c2 /innobase/que | |
parent | e5dc68abe4f6666b50082f03ea3c84f370ce5a45 (diff) | |
parent | 49e4a3a3d6dbf59bab161d6a9e13534d3a77dda9 (diff) | |
download | mariadb-git-963ea1ae0ac9d5b837d8ff35276ef34afa075295.tar.gz |
Merge from 3.23.48 tree
BitKeeper/etc/logging_ok:
auto-union
Docs/manual.texi:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/include/srv0srv.h:
Auto merged
innobase/mem/mem0dbg.c:
Auto merged
innobase/os/os0file.c:
Auto merged
innobase/que/que0que.c:
Auto merged
innobase/rem/rem0rec.c:
Auto merged
innobase/row/row0sel.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
innobase/srv/srv0start.c:
Auto merged
innobase/sync/sync0arr.c:
Auto merged
innobase/trx/trx0trx.c:
Auto merged
innobase/trx/trx0undo.c:
Auto merged
myisam/mi_check.c:
Auto merged
mysql-test/t/join.test:
Auto merged
mysys/hash.c:
Auto merged
scripts/mysql_config.sh:
Auto merged
sql/ha_innodb.h:
Auto merged
sql/handler.cc:
Auto merged
sql/handler.h:
Auto merged
sql/sql_acl.cc:
Auto merged
Diffstat (limited to 'innobase/que')
-rw-r--r-- | innobase/que/que0que.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c index 67f7b48187d..1cee316f32c 100644 --- a/innobase/que/que0que.c +++ b/innobase/que/que0que.c @@ -183,6 +183,8 @@ que_thr_create( thr->common.type = QUE_NODE_THR; thr->common.parent = parent; + thr->magic_n = QUE_THR_MAGIC_N; + thr->graph = parent->graph; thr->state = QUE_THR_COMMAND_WAIT; @@ -485,7 +487,6 @@ que_graph_free_recursive( tab_node_t* cre_tab; ind_node_t* cre_ind; - if (node == NULL) { return; @@ -509,6 +510,16 @@ que_graph_free_recursive( thr = node; + if (thr->magic_n != QUE_THR_MAGIC_N) { + fprintf(stderr, + "que_thr struct appears corrupt; magic n %lu\n", + thr->magic_n); + mem_analyze_corruption((byte*)thr); + ut_a(0); + } + + thr->magic_n = QUE_THR_MAGIC_FREED; + que_graph_free_recursive(thr->child); break; @@ -606,6 +617,10 @@ que_graph_free_recursive( break; default: + fprintf(stderr, + "que_node struct appears corrupt; type %lu\n", + que_node_get_type(node)); + mem_analyze_corruption((byte*)node); ut_a(0); } } @@ -1068,20 +1083,29 @@ que_thr_stop_for_mysql( mutex_exit(&kernel_mutex); } - /************************************************************************** Moves a thread from another state to the QUE_THR_RUNNING state. Increments the n_active_thrs counters of the query graph and transaction if thr was not active. */ + void que_thr_move_to_run_state_for_mysql( /*================================*/ que_thr_t* thr, /* in: an query thread */ trx_t* trx) /* in: transaction */ { + if (thr->magic_n != QUE_THR_MAGIC_N) { + fprintf(stderr, + "que_thr struct appears corrupt; magic n %lu\n", thr->magic_n); + + mem_analyze_corruption((byte*)thr); + + ut_a(0); + } + if (!thr->is_active) { - (thr->graph)->n_active_thrs++; + thr->graph->n_active_thrs++; trx->n_active_thrs++; @@ -1097,6 +1121,7 @@ que_thr_move_to_run_state_for_mysql( /************************************************************************** A patch for MySQL used to 'stop' a dummy query thread used in MySQL select, when there is no error or lock wait. */ + void que_thr_stop_for_mysql_no_error( /*============================*/ @@ -1105,6 +1130,15 @@ que_thr_stop_for_mysql_no_error( { ut_ad(thr->state == QUE_THR_RUNNING); + if (thr->magic_n != QUE_THR_MAGIC_N) { + fprintf(stderr, + "que_thr struct appears corrupt; magic n %lu\n", thr->magic_n); + + mem_analyze_corruption((byte*)thr); + + ut_a(0); + } + thr->state = QUE_THR_COMPLETED; thr->is_active = FALSE; |