#include "univ.i"#include "data0data.h"#include "dict0types.h"#include "trx0trx.h"#include "srv0srv.h"#include "usr0types.h"#include "que0types.h"#include "row0types.h"#include "pars0types.h"Include dependency graph for que0que.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define QUE_FORK_ACTIVE 1 |
Definition at line 440 of file que0que.h.
Referenced by que_fork_start_command(), que_thr_stop(), row_get_prebuilt_insert_row(), row_get_prebuilt_update_vector(), and row_prebuild_sel_graph().
| #define QUE_FORK_BEING_FREED 4 |
| #define QUE_FORK_COMMAND_WAIT 2 |
| #define QUE_FORK_MYSQL_INTERFACE 10 |
Definition at line 436 of file que0que.h.
Referenced by pars_complete_graph_for_exec(), que_eval_sql(), and que_thr_dec_refer_count().
| #define QUE_FORK_PROCEDURE 8 |
| #define QUE_FORK_PURGE 6 |
Definition at line 432 of file que0que.h.
Referenced by que_thr_dec_refer_count(), and trx_purge_graph_build().
| #define QUE_FORK_RECOVERY 11 |
Definition at line 437 of file que0que.h.
Referenced by que_thr_dec_refer_count(), and trx_rollback_or_clean_all_without_sess().
| #define QUE_FORK_ROLLBACK 5 |
Definition at line 429 of file que0que.h.
Referenced by que_thr_dec_refer_count(), que_thr_stop(), and trx_roll_graph_build().
| #define QUE_NODE_ASSIGNMENT 23 |
Definition at line 470 of file que0que.h.
Referenced by assign_step(), pars_assignment_statement(), que_graph_free_recursive(), que_node_print_info(), and que_thr_step().
| #define QUE_NODE_COL_ASSIGNMENT 26 |
| #define QUE_NODE_COMMIT 11 |
Definition at line 458 of file que0que.h.
Referenced by commit_node_create(), que_graph_free_recursive(), que_node_print_info(), que_thr_step(), and trx_commit_step().
| #define QUE_NODE_CONTROL_STAT 1024 |
| #define QUE_NODE_CREATE_INDEX 15 |
Definition at line 462 of file que0que.h.
Referenced by dict_create_index_step(), ind_create_graph_create(), que_graph_free_recursive(), que_node_print_info(), and que_thr_step().
| #define QUE_NODE_CREATE_TABLE 14 |
Definition at line 461 of file que0que.h.
Referenced by dict_create_table_step(), que_graph_free_recursive(), que_node_print_info(), que_thr_step(), and tab_create_graph_create().
| #define QUE_NODE_ELSIF 30 |
Definition at line 477 of file que0que.h.
Referenced by pars_elsif_element(), pars_if_statement(), and que_graph_free_recursive().
| #define QUE_NODE_EXIT 32 |
Definition at line 479 of file que0que.h.
Referenced by exit_step(), pars_exit_statement(), que_graph_free_recursive(), que_node_print_info(), and que_thr_step().
| #define QUE_NODE_FETCH 24 |
Definition at line 471 of file que0que.h.
Referenced by fetch_step(), pars_fetch_statement(), que_graph_free_recursive(), que_node_print_info(), and que_thr_step().
| #define QUE_NODE_FOR (27 + QUE_NODE_CONTROL_STAT) |
Definition at line 474 of file que0que.h.
Referenced by for_step(), pars_for_statement(), que_graph_free_recursive(), que_node_get_containing_loop_node(), que_node_print_info(), and que_thr_step().
| #define QUE_NODE_FORK 8 |
Definition at line 455 of file que0que.h.
Referenced by que_fork_create(), and que_graph_free_recursive().
| #define QUE_NODE_FUNC 18 |
Definition at line 465 of file que0que.h.
Referenced by eval_aggregate(), eval_arith(), eval_cmp(), eval_func(), eval_logical(), eval_node_alloc_val_buf(), eval_node_free_val_buf(), eval_predefined_2(), opt_check_exp_determined_before(), opt_find_all_cols(), opt_find_copy_cols(), opt_look_for_col_in_cond_before(), pars_check_aggregate(), pars_func_low(), pars_resolve_exp_columns(), pars_resolve_exp_variables_and_types(), pars_resolve_func_data_type(), que_graph_free_recursive(), que_node_print_info(), and que_thr_step().
| #define QUE_NODE_IF (21 + QUE_NODE_CONTROL_STAT) |
Definition at line 468 of file que0que.h.
Referenced by if_step(), pars_if_statement(), que_graph_free_recursive(), que_node_print_info(), and que_thr_step().
| #define QUE_NODE_INSERT 2 |
Definition at line 450 of file que0que.h.
Referenced by ins_node_create(), que_graph_free_recursive(), que_node_print_info(), que_thr_step(), and row_ins_step().
| #define QUE_NODE_LOCK 1 |
Definition at line 449 of file que0que.h.
Referenced by que_graph_free_recursive(), que_node_print_info(), and que_thr_step().
| #define QUE_NODE_OPEN 25 |
Definition at line 472 of file que0que.h.
Referenced by pars_open_statement(), que_graph_free_recursive(), que_node_print_info(), and que_thr_step().
| #define QUE_NODE_ORDER 19 |
Definition at line 466 of file que0que.h.
Referenced by pars_order_by(), and que_graph_free_recursive().
| #define QUE_NODE_PROC (20 + QUE_NODE_CONTROL_STAT) |
Definition at line 467 of file que0que.h.
Referenced by pars_procedure_definition(), que_graph_free_recursive(), que_node_print_info(), que_thr_step(), and return_step().
| #define QUE_NODE_PURGE 13 |
Definition at line 460 of file que0que.h.
Referenced by que_node_print_info(), que_thr_step(), row_purge_node_create(), and row_purge_step().
| #define QUE_NODE_RETURN 28 |
Definition at line 475 of file que0que.h.
Referenced by pars_return_statement(), que_graph_free_recursive(), que_node_print_info(), que_thr_step(), and return_step().
| #define QUE_NODE_ROLLBACK 12 |
Definition at line 459 of file que0que.h.
Referenced by que_graph_free_recursive(), que_node_print_info(), que_thr_step(), roll_node_create(), and trx_rollback_step().
| #define QUE_NODE_ROW_PRINTF 29 |
Definition at line 476 of file que0que.h.
Referenced by pars_row_printf_statement(), que_graph_free_recursive(), que_thr_step(), and row_printf_step().
| #define QUE_NODE_SELECT 6 |
Definition at line 453 of file que0que.h.
Referenced by que_graph_free_recursive(), que_node_print_info(), que_thr_step(), row_sel_step(), and sel_node_create().
| #define QUE_NODE_SYMBOL 16 |
Definition at line 463 of file que0que.h.
Referenced by eval_node_alloc_val_buf(), eval_node_free_val_buf(), eval_notfound(), eval_replstr(), opt_check_exp_determined_before(), opt_find_all_cols(), opt_look_for_col_in_comparison_before(), opt_normalize_cmp_conds(), pars_resolve_exp_columns(), pars_resolve_exp_variables_and_types(), pars_retrieve_table_def(), sel_col_prefetch_buf_alloc(), sym_tab_add_bound_id(), sym_tab_add_bound_lit(), sym_tab_add_id(), sym_tab_add_int_lit(), sym_tab_add_null_lit(), and sym_tab_add_str_lit().
| #define QUE_NODE_THR 9 |
Definition at line 456 of file que0que.h.
Referenced by que_graph_free_recursive(), que_node_print_info(), que_thr_create(), and que_thr_step().
| #define QUE_NODE_UNDO 10 |
Definition at line 457 of file que0que.h.
Referenced by que_graph_free_recursive(), que_node_print_info(), que_thr_step(), row_undo_node_create(), and row_undo_step().
| #define QUE_NODE_UPDATE 4 |
Definition at line 451 of file que0que.h.
Referenced by que_graph_free_recursive(), que_node_print_info(), que_thr_step(), row_ins_cascade_ancestor_updates_table(), row_ins_cascade_n_ancestors(), row_ins_check_foreign_constraint(), row_upd_in_place_in_select(), row_upd_step(), and upd_node_create().
| #define QUE_NODE_WHILE (22 + QUE_NODE_CONTROL_STAT) |
Definition at line 469 of file que0que.h.
Referenced by pars_while_statement(), que_graph_free_recursive(), que_node_get_containing_loop_node(), que_node_print_info(), que_thr_step(), and while_step().
| #define QUE_THR_COMMAND_WAIT 4 |
Definition at line 489 of file que0que.h.
Referenced by que_fork_start_command(), que_run_threads(), and que_thr_create().
| #define QUE_THR_COMPLETED 3 |
Definition at line 484 of file que0que.h.
Referenced by que_fork_error_handle(), que_fork_start_command(), que_run_threads(), que_thr_dec_refer_count(), que_thr_node_step(), que_thr_stop(), que_thr_stop_for_mysql(), and que_thr_stop_for_mysql_no_error().
| #define QUE_THR_LOCK_NOLOCK 0 |
Definition at line 496 of file que0que.h.
Referenced by que_thr_create(), row_insert_for_mysql(), row_search_for_mysql(), and row_update_for_mysql().
| #define QUE_THR_LOCK_ROW 1 |
Definition at line 497 of file que0que.h.
Referenced by row_insert_for_mysql(), row_search_for_mysql(), row_update_for_mysql(), and srv_suspend_mysql_thread().
| #define QUE_THR_LOCK_WAIT 5 |
Definition at line 490 of file que0que.h.
Referenced by que_fork_error_handle(), que_fork_start_command(), que_run_threads(), que_thr_end_wait(), que_thr_end_wait_no_next_thr(), and que_thr_stop().
| #define QUE_THR_MAGIC_FREED 123461526 |
| #define QUE_THR_MAGIC_N 8476583 |
Definition at line 372 of file que0que.h.
Referenced by que_graph_free_recursive(), que_thr_create(), que_thr_move_to_run_state_for_mysql(), and que_thr_stop_for_mysql_no_error().
| #define QUE_THR_PROCEDURE_WAIT 2 |
Definition at line 483 of file que0que.h.
Referenced by que_thr_end_wait(), and que_thr_end_wait_no_next_thr().
| #define QUE_THR_RUNNING 1 |
Definition at line 482 of file que0que.h.
Referenced by que_run_threads(), que_run_threads_low(), que_thr_dec_refer_count(), que_thr_move_to_run_state(), que_thr_move_to_run_state_for_mysql(), que_thr_step(), que_thr_stop_for_mysql(), que_thr_stop_for_mysql_no_error(), srv_que_round_robin(), and srv_suspend_mysql_thread().
| #define QUE_THR_SIG_REPLY_WAIT 6 |
Definition at line 491 of file que0que.h.
Referenced by que_fork_error_handle(), que_thr_end_wait(), que_thr_end_wait_no_next_thr(), trx_commit_step(), trx_rollback_step(), trx_sig_reply(), and trx_sig_reply_wait_to_suspended().
| #define QUE_THR_SUSPENDED 7 |
Definition at line 492 of file que0que.h.
Referenced by que_fork_start_command(), que_thr_stop(), trx_lock_wait_to_suspended(), and trx_sig_reply_wait_to_suspended().
| ulint que_eval_sql | ( | pars_info_t * | info, | |
| const char * | sql, | |||
| ibool | reserve_dict_mutex, | |||
| trx_t * | trx | |||
| ) |
Definition at line 1415 of file que0que.c.
References DB_SUCCESS, dict_sys, trx_struct::error_state, que_fork_struct::fork_type, trx_struct::graph, dict_sys_struct::mutex, mutex_enter, mutex_exit(), NULL, pars_sql(), QUE_FORK_MYSQL_INTERFACE, que_fork_start_command(), que_graph_free(), que_run_threads(), que_fork_struct::trx, and ut_a.
Referenced by dict_create_or_check_foreign_constraint_tables(), dict_foreign_eval_sql(), row_delete_constraint_low(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), row_rename_table_for_mysql(), and row_truncate_table_for_mysql().
01417 : error code or DB_SUCCESS */ 01418 pars_info_t* info, /* in: info struct, or NULL */ 01419 const char* sql, /* in: SQL string */ 01420 ibool reserve_dict_mutex, 01421 /* in: if TRUE, acquire/release 01422 dict_sys->mutex around call to pars_sql. */ 01423 trx_t* trx) /* in: trx */ 01424 { 01425 que_thr_t* thr; 01426 que_t* graph; 01427 01428 ut_a(trx->error_state == DB_SUCCESS); 01429 01430 if (reserve_dict_mutex) { 01431 mutex_enter(&dict_sys->mutex); 01432 } 01433 01434 graph = pars_sql(info, sql); 01435 01436 if (reserve_dict_mutex) { 01437 mutex_exit(&dict_sys->mutex); 01438 } 01439 01440 ut_a(graph); 01441 01442 graph->trx = trx; 01443 trx->graph = NULL; 01444 01445 graph->fork_type = QUE_FORK_MYSQL_INTERFACE; 01446 01447 ut_a(thr = que_fork_start_command(graph)); 01448 01449 que_run_threads(thr); 01450 01451 que_graph_free(graph); 01452 01453 return(trx->error_state); 01454 }
Here is the call graph for this function:

Here is the caller graph for this function:

| que_fork_t* que_fork_create | ( | que_t * | graph, | |
| que_node_t * | parent, | |||
| ulint | fork_type, | |||
| mem_heap_t * | heap | |||
| ) |
Definition at line 141 of file que0que.c.
References que_fork_struct::caller, que_fork_struct::common, que_fork_struct::fork_type, que_fork_struct::graph, que_fork_struct::heap, que_fork_struct::info, mem_heap_alloc(), que_fork_struct::n_active_thrs, NULL, que_common_struct::parent, QUE_FORK_COMMAND_WAIT, QUE_NODE_FORK, que_fork_struct::state, que_fork_struct::sym_tab, que_fork_struct::thrs, que_common_struct::type, ut_ad, and UT_LIST_INIT.
Referenced by pars_complete_graph_for_exec(), pars_procedure_definition(), trx_purge_graph_build(), trx_roll_graph_build(), and trx_rollback_or_clean_all_without_sess().
00143 : fork node */ 00144 que_t* graph, /* in: graph, if NULL then this 00145 fork node is assumed to be the 00146 graph root */ 00147 que_node_t* parent, /* in: parent node */ 00148 ulint fork_type, /* in: fork type */ 00149 mem_heap_t* heap) /* in: memory heap where created */ 00150 { 00151 que_fork_t* fork; 00152 00153 ut_ad(heap); 00154 00155 fork = mem_heap_alloc(heap, sizeof(que_fork_t)); 00156 00157 fork->common.type = QUE_NODE_FORK; 00158 fork->n_active_thrs = 0; 00159 00160 fork->state = QUE_FORK_COMMAND_WAIT; 00161 00162 if (graph != NULL) { 00163 fork->graph = graph; 00164 } else { 00165 fork->graph = fork; 00166 } 00167 00168 fork->common.parent = parent; 00169 fork->fork_type = fork_type; 00170 00171 fork->caller = NULL; 00172 00173 UT_LIST_INIT(fork->thrs); 00174 00175 fork->sym_tab = NULL; 00176 fork->info = NULL; 00177 00178 fork->heap = heap; 00179 00180 return(fork); 00181 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE que_node_t* que_fork_get_child | ( | que_fork_t * | fork | ) |
| UNIV_INLINE que_thr_t* que_fork_get_first_thr | ( | que_fork_t * | fork | ) |
Referenced by row_insert_for_mysql(), row_lock_table_autoinc_for_mysql(), row_lock_table_for_mysql(), row_search_for_mysql(), and row_update_for_mysql().
Here is the caller graph for this function:

| que_thr_t* que_fork_start_command | ( | que_fork_t * | fork | ) |
Definition at line 329 of file que0que.c.
References que_fork_struct::last_sel_node, NULL, QUE_FORK_ACTIVE, QUE_THR_COMMAND_WAIT, QUE_THR_COMPLETED, que_thr_init_command(), QUE_THR_LOCK_WAIT, que_thr_move_to_run_state(), QUE_THR_SUSPENDED, que_fork_struct::state, que_thr_struct::state, que_fork_struct::thrs, ut_ad, UT_LIST_GET_FIRST, and UT_LIST_GET_NEXT.
Referenced by que_eval_sql(), row_create_index_for_mysql(), row_create_table_for_mysql(), trx_general_rollback_for_mysql(), trx_purge(), trx_rollback(), and trx_rollback_or_clean_all_without_sess().
00331 : a query thread of the graph moved to 00332 QUE_THR_RUNNING state, or NULL; the query 00333 thread should be executed by que_run_threads 00334 by the caller */ 00335 que_fork_t* fork) /* in: a query fork */ 00336 { 00337 que_thr_t* thr; 00338 00339 fork->state = QUE_FORK_ACTIVE; 00340 00341 fork->last_sel_node = NULL; 00342 00343 /* Choose the query thread to run: usually there is just one thread, 00344 but in a parallelized select, which necessarily is non-scrollable, 00345 there may be several to choose from */ 00346 00347 /*--------------------------------------------------------------- 00348 First we try to find a query thread in the QUE_THR_COMMAND_WAIT state */ 00349 00350 thr = UT_LIST_GET_FIRST(fork->thrs); 00351 00352 while (thr != NULL) { 00353 if (thr->state == QUE_THR_COMMAND_WAIT) { 00354 00355 /* We have to send the initial message to query thread 00356 to start it */ 00357 00358 que_thr_init_command(thr); 00359 00360 return(thr); 00361 } 00362 00363 ut_ad(thr->state != QUE_THR_LOCK_WAIT); 00364 00365 thr = UT_LIST_GET_NEXT(thrs, thr); 00366 } 00367 00368 /*---------------------------------------------------------------- 00369 Then we try to find a query thread in the QUE_THR_SUSPENDED state */ 00370 00371 thr = UT_LIST_GET_FIRST(fork->thrs); 00372 00373 while (thr != NULL) { 00374 if (thr->state == QUE_THR_SUSPENDED) { 00375 /* In this case the execution of the thread was 00376 suspended: no initial message is needed because 00377 execution can continue from where it was left */ 00378 00379 que_thr_move_to_run_state(thr); 00380 00381 return(thr); 00382 } 00383 00384 thr = UT_LIST_GET_NEXT(thrs, thr); 00385 } 00386 00387 /*----------------------------------------------------------------- 00388 Then we try to find a query thread in the QUE_THR_COMPLETED state */ 00389 00390 thr = UT_LIST_GET_FIRST(fork->thrs); 00391 00392 while (thr != NULL) { 00393 if (thr->state == QUE_THR_COMPLETED) { 00394 que_thr_init_command(thr); 00395 00396 return(thr); 00397 } 00398 00399 thr = UT_LIST_GET_NEXT(thrs, thr); 00400 } 00401 00402 /* Else we return NULL */ 00403 return(NULL); 00404 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void que_graph_free | ( | que_t * | graph | ) |
Definition at line 658 of file que0que.c.
References pars_info_struct::graph_owns_us, que_fork_struct::heap, que_fork_struct::info, mem_heap_free, pars_info_free(), que_graph_free_recursive(), que_fork_struct::sym_tab, sym_tab_free_private(), and ut_ad.
Referenced by que_eval_sql(), que_graph_try_free(), row_create_index_for_mysql(), row_create_table_for_mysql(), and trx_finish_rollback_off_kernel().
00660 : query graph; we assume that the memory 00661 heap where this graph was created is private 00662 to this graph: if not, then use 00663 que_graph_free_recursive and free the heap 00664 afterwards! */ 00665 { 00666 ut_ad(graph); 00667 00668 if (graph->sym_tab) { 00669 /* The following call frees dynamic memory allocated 00670 for variables etc. during execution. Frees also explicit 00671 cursor definitions. */ 00672 00673 sym_tab_free_private(graph->sym_tab); 00674 } 00675 00676 if (graph->info && graph->info->graph_owns_us) { 00677 pars_info_free(graph->info); 00678 } 00679 00680 que_graph_free_recursive(graph); 00681 00682 mem_heap_free(graph->heap); 00683 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void que_graph_free_recursive | ( | que_node_t * | node | ) |
Definition at line 496 of file que0que.c.
References btr_pcur_free_for_mysql(), upd_node_struct::cascade_heap, upd_node_struct::cascade_node, que_thr_struct::child, tab_node_struct::col_def, tab_node_struct::commit_node, ind_node_struct::commit_node, ins_node_struct::entry_sys_heap, ind_node_struct::field_def, undo_node_struct::heap, upd_node_struct::heap, tab_node_struct::heap, ind_node_struct::heap, upd_node_struct::in_mysql_interface, ind_node_struct::ind_def, que_thr_struct::magic_n, mem_analyze_corruption(), mem_heap_free, NULL, upd_node_struct::pcur, que_graph_free_recursive(), que_graph_free_stat_list(), QUE_NODE_ASSIGNMENT, QUE_NODE_COMMIT, QUE_NODE_CREATE_INDEX, QUE_NODE_CREATE_TABLE, QUE_NODE_ELSIF, QUE_NODE_EXIT, QUE_NODE_FETCH, QUE_NODE_FOR, QUE_NODE_FORK, QUE_NODE_FUNC, que_node_get_type(), QUE_NODE_IF, QUE_NODE_INSERT, QUE_NODE_LOCK, QUE_NODE_OPEN, QUE_NODE_ORDER, QUE_NODE_PROC, QUE_NODE_RETURN, QUE_NODE_ROLLBACK, QUE_NODE_ROW_PRINTF, QUE_NODE_SELECT, QUE_NODE_THR, QUE_NODE_UNDO, QUE_NODE_UPDATE, QUE_NODE_WHILE, QUE_THR_MAGIC_FREED, QUE_THR_MAGIC_N, sel, sel_node_free_private(), ins_node_struct::select, upd_node_struct::select, tab_node_struct::tab_def, que_fork_struct::thrs, ut_error, UT_LIST_GET_FIRST, and UT_LIST_GET_NEXT.
Referenced by que_graph_free(), que_graph_free_recursive(), que_graph_free_stat_list(), row_prebuilt_free(), and sym_tab_free_private().
00498 : query graph node */ 00499 { 00500 que_fork_t* fork; 00501 que_thr_t* thr; 00502 undo_node_t* undo; 00503 sel_node_t* sel; 00504 ins_node_t* ins; 00505 upd_node_t* upd; 00506 tab_node_t* cre_tab; 00507 ind_node_t* cre_ind; 00508 00509 if (node == NULL) { 00510 00511 return; 00512 } 00513 00514 switch (que_node_get_type(node)) { 00515 00516 case QUE_NODE_FORK: 00517 fork = node; 00518 00519 thr = UT_LIST_GET_FIRST(fork->thrs); 00520 00521 while (thr) { 00522 que_graph_free_recursive(thr); 00523 00524 thr = UT_LIST_GET_NEXT(thrs, thr); 00525 } 00526 00527 break; 00528 case QUE_NODE_THR: 00529 00530 thr = node; 00531 00532 if (thr->magic_n != QUE_THR_MAGIC_N) { 00533 fprintf(stderr, 00534 "que_thr struct appears corrupt; magic n %lu\n", 00535 (unsigned long) thr->magic_n); 00536 mem_analyze_corruption(thr); 00537 ut_error; 00538 } 00539 00540 thr->magic_n = QUE_THR_MAGIC_FREED; 00541 00542 que_graph_free_recursive(thr->child); 00543 00544 break; 00545 case QUE_NODE_UNDO: 00546 00547 undo = node; 00548 00549 mem_heap_free(undo->heap); 00550 00551 break; 00552 case QUE_NODE_SELECT: 00553 00554 sel = node; 00555 00556 sel_node_free_private(sel); 00557 00558 break; 00559 case QUE_NODE_INSERT: 00560 00561 ins = node; 00562 00563 que_graph_free_recursive(ins->select); 00564 00565 mem_heap_free(ins->entry_sys_heap); 00566 00567 break; 00568 case QUE_NODE_UPDATE: 00569 00570 upd = node; 00571 00572 if (upd->in_mysql_interface) { 00573 00574 btr_pcur_free_for_mysql(upd->pcur); 00575 } 00576 00577 que_graph_free_recursive(upd->cascade_node); 00578 00579 if (upd->cascade_heap) { 00580 mem_heap_free(upd->cascade_heap); 00581 } 00582 00583 que_graph_free_recursive(upd->select); 00584 00585 mem_heap_free(upd->heap); 00586 00587 break; 00588 case QUE_NODE_CREATE_TABLE: 00589 cre_tab = node; 00590 00591 que_graph_free_recursive(cre_tab->tab_def); 00592 que_graph_free_recursive(cre_tab->col_def); 00593 que_graph_free_recursive(cre_tab->commit_node); 00594 00595 mem_heap_free(cre_tab->heap); 00596 00597 break; 00598 case QUE_NODE_CREATE_INDEX: 00599 cre_ind = node; 00600 00601 que_graph_free_recursive(cre_ind->ind_def); 00602 que_graph_free_recursive(cre_ind->field_def); 00603 que_graph_free_recursive(cre_ind->commit_node); 00604 00605 mem_heap_free(cre_ind->heap); 00606 00607 break; 00608 case QUE_NODE_PROC: 00609 que_graph_free_stat_list(((proc_node_t*)node)->stat_list); 00610 00611 break; 00612 case QUE_NODE_IF: 00613 que_graph_free_stat_list(((if_node_t*)node)->stat_list); 00614 que_graph_free_stat_list(((if_node_t*)node)->else_part); 00615 que_graph_free_stat_list(((if_node_t*)node)->elsif_list); 00616 00617 break; 00618 case QUE_NODE_ELSIF: 00619 que_graph_free_stat_list(((elsif_node_t*)node)->stat_list); 00620 00621 break; 00622 case QUE_NODE_WHILE: 00623 que_graph_free_stat_list(((while_node_t*)node)->stat_list); 00624 00625 break; 00626 case QUE_NODE_FOR: 00627 que_graph_free_stat_list(((for_node_t*)node)->stat_list); 00628 00629 break; 00630 00631 case QUE_NODE_ASSIGNMENT: 00632 case QUE_NODE_EXIT: 00633 case QUE_NODE_RETURN: 00634 case QUE_NODE_COMMIT: 00635 case QUE_NODE_ROLLBACK: 00636 case QUE_NODE_LOCK: 00637 case QUE_NODE_FUNC: 00638 case QUE_NODE_ORDER: 00639 case QUE_NODE_ROW_PRINTF: 00640 case QUE_NODE_OPEN: 00641 case QUE_NODE_FETCH: 00642 /* No need to do anything */ 00643 00644 break; 00645 default: 00646 fprintf(stderr, 00647 "que_node struct appears corrupt; type %lu\n", 00648 (unsigned long) que_node_get_type(node)); 00649 mem_analyze_corruption(node); 00650 ut_error; 00651 } 00652 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE ibool que_graph_is_select | ( | que_t * | graph | ) |
Definition at line 125 of file que0que.c.
References sess_struct::graphs, kernel_mutex, ut_ad, and UT_LIST_ADD_LAST.
00127 : graph */ 00128 sess_t* sess) /* in: session */ 00129 { 00130 #ifdef UNIV_SYNC_DEBUG 00131 ut_ad(mutex_own(&kernel_mutex)); 00132 #endif /* UNIV_SYNC_DEBUG */ 00133 00134 UT_LIST_ADD_LAST(graphs, sess->graphs, graph); 00135 }
| ibool que_graph_try_free | ( | que_t * | graph | ) |
Definition at line 691 of file que0que.c.
References FALSE, sess_struct::graphs, kernel_mutex, que_fork_struct::n_active_thrs, QUE_FORK_BEING_FREED, que_graph_free(), sess_try_close(), que_fork_struct::state, TRUE, que_fork_struct::trx, ut_ad, and UT_LIST_REMOVE.
00693 : TRUE if freed */ 00694 que_t* graph) /* in: query graph */ 00695 { 00696 sess_t* sess; 00697 00698 #ifdef UNIV_SYNC_DEBUG 00699 ut_ad(mutex_own(&kernel_mutex)); 00700 #endif /* UNIV_SYNC_DEBUG */ 00701 00702 sess = (graph->trx)->sess; 00703 00704 if ((graph->state == QUE_FORK_BEING_FREED) 00705 && (graph->n_active_thrs == 0)) { 00706 00707 UT_LIST_REMOVE(graphs, sess->graphs, graph); 00708 que_graph_free(graph); 00709 00710 sess_try_close(sess); 00711 00712 return(TRUE); 00713 } 00714 00715 return(FALSE); 00716 }
Here is the call graph for this function:

| que_node_t* que_node_get_containing_loop_node | ( | que_node_t * | node | ) |
Definition at line 1083 of file que0que.c.
References QUE_NODE_FOR, que_node_get_parent(), que_node_get_type(), QUE_NODE_WHILE, and ut_ad.
Referenced by exit_step(), and que_thr_step().
01085 : containing loop node, or NULL. */ 01086 que_node_t* node) /* in: node */ 01087 { 01088 ut_ad(node); 01089 01090 for (;;) { 01091 ulint type; 01092 01093 node = que_node_get_parent(node); 01094 01095 if (!node) { 01096 break; 01097 } 01098 01099 type = que_node_get_type(node); 01100 01101 if ((type == QUE_NODE_FOR) || (type == QUE_NODE_WHILE)) { 01102 break; 01103 } 01104 } 01105 01106 return(node); 01107 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE dtype_t* que_node_get_data_type | ( | que_node_t * | node | ) |
Referenced by eval_to_binary(), pars_resolve_exp_variables_and_types(), and pars_resolve_func_data_type().
Here is the caller graph for this function:

| UNIV_INLINE que_node_t* que_node_get_next | ( | que_node_t * | node | ) |
Referenced by eval_arith(), eval_cmp(), eval_concat(), eval_func(), eval_instr(), eval_logical(), eval_notfound(), eval_predefined_2(), eval_replstr(), eval_substr(), eval_to_binary(), for_step(), if_step(), opt_check_exp_determined_before(), opt_classify_cols(), opt_find_all_cols(), opt_find_copy_cols(), opt_find_test_conds(), opt_is_arg(), opt_look_for_col_in_comparison_before(), opt_look_for_col_in_cond_before(), opt_normalize_cmp_conds(), opt_search_plan(), pars_check_aggregate(), pars_create_index(), pars_create_table(), pars_if_statement(), pars_process_assign_list(), pars_resolve_exp_columns(), pars_resolve_exp_list_columns(), pars_resolve_exp_list_variables_and_types(), pars_resolve_exp_variables_and_types(), pars_retrieve_table_list_defs(), pars_select_all_columns(), pars_set_parent_in_list(), que_graph_free_stat_list(), que_thr_step(), row_fetch_print(), row_ins_get_row_from_select(), row_ins_get_row_from_values(), row_printf_step(), row_sel_open_pcur(), row_sel_step(), sel_assign_into_var_values(), sel_eval_select_list(), sel_reset_aggregate_vals(), and while_step().
Here is the caller graph for this function:

| UNIV_INLINE que_node_t* que_node_get_parent | ( | que_node_t * | node | ) |
Referenced by assign_step(), dict_create_index_step(), dict_create_table_step(), exit_step(), fetch_step(), for_step(), if_step(), que_node_get_containing_loop_node(), que_thr_step(), return_step(), row_create_index_for_mysql(), row_create_table_for_mysql(), row_get_prebuilt_insert_row(), row_get_prebuilt_update_vector(), row_ins_cascade_ancestor_updates_table(), row_ins_cascade_n_ancestors(), row_ins_step(), row_prebuild_sel_graph(), row_printf_step(), row_purge(), row_sel(), row_sel_step(), row_undo(), row_upd_in_place_in_select(), row_upd_step(), trx_commit_step(), trx_general_rollback_for_mysql(), trx_rollback_step(), and while_step().
Here is the caller graph for this function:

| UNIV_INLINE ulint que_node_get_type | ( | que_node_t * | node | ) |
Referenced by assign_step(), dict_create_index_step(), dict_create_table_step(), eval_aggregate(), eval_arith(), eval_cmp(), eval_func(), eval_logical(), eval_node_alloc_val_buf(), eval_node_free_val_buf(), eval_notfound(), eval_predefined_2(), eval_replstr(), exit_step(), fetch_step(), for_step(), if_step(), opt_check_exp_determined_before(), opt_find_all_cols(), opt_find_copy_cols(), opt_look_for_col_in_comparison_before(), opt_look_for_col_in_cond_before(), opt_normalize_cmp_conds(), pars_check_aggregate(), pars_if_statement(), pars_resolve_exp_columns(), pars_resolve_exp_variables_and_types(), pars_resolve_func_data_type(), pars_retrieve_table_def(), que_graph_free_recursive(), que_node_get_containing_loop_node(), que_node_print_info(), que_thr_step(), return_step(), row_ins_cascade_ancestor_updates_table(), row_ins_cascade_n_ancestors(), row_ins_check_foreign_constraint(), row_ins_step(), row_printf_step(), row_purge_step(), row_sel_step(), row_undo_step(), row_upd_in_place_in_select(), row_upd_step(), sel_col_prefetch_buf_alloc(), trx_commit_step(), trx_rollback_step(), and while_step().
Here is the caller graph for this function:

| UNIV_INLINE dfield_t* que_node_get_val | ( | que_node_t * | node | ) |
Referenced by eval_binary_to_number(), eval_cmp(), eval_concat(), eval_func(), eval_instr(), eval_node_alloc_val_buf(), eval_node_free_val_buf(), eval_notfound(), eval_predefined(), eval_predefined_2(), eval_replstr(), eval_substr(), eval_to_binary(), pars_assignment_statement(), pars_column_def(), pars_create_table(), pars_resolve_exp_variables_and_types(), pars_variable_declaration(), row_fetch_print(), row_fetch_store_uint4(), row_ins_get_row_from_select(), row_ins_get_row_from_values(), row_printf_step(), row_sel_fetch_columns(), row_sel_open_pcur(), row_upd_eval_new_vals(), sel_pop_prefetched_row(), and sel_push_prefetched_row().
Here is the caller graph for this function:

| UNIV_INLINE ulint que_node_get_val_buf_size | ( | que_node_t * | node | ) |
Referenced by eval_node_free_val_buf(), sel_pop_prefetched_row(), and sel_push_prefetched_row().
Here is the caller graph for this function:

| UNIV_INLINE que_node_t* que_node_list_add_last | ( | que_node_t * | node_list, | |
| que_node_t * | node | |||
| ) |
Referenced by opt_normalize_cmp_conds(), pars_op(), pars_select_all_columns(), pars_update_statement(), and yyparse().
Here is the caller graph for this function:

| UNIV_INLINE ulint que_node_list_get_len | ( | que_node_t * | node_list | ) |
Referenced by pars_create_index(), pars_create_table(), pars_fetch_statement(), pars_insert_statement(), and pars_select_statement().
Here is the caller graph for this function:

| void que_node_print_info | ( | que_node_t * | node | ) |
Definition at line 1113 of file que0que.c.
References QUE_NODE_ASSIGNMENT, QUE_NODE_COMMIT, QUE_NODE_CREATE_INDEX, QUE_NODE_CREATE_TABLE, QUE_NODE_EXIT, QUE_NODE_FETCH, QUE_NODE_FOR, QUE_NODE_FUNC, que_node_get_type(), QUE_NODE_IF, QUE_NODE_INSERT, QUE_NODE_LOCK, QUE_NODE_OPEN, QUE_NODE_PROC, QUE_NODE_PURGE, QUE_NODE_RETURN, QUE_NODE_ROLLBACK, QUE_NODE_SELECT, QUE_NODE_THR, QUE_NODE_UNDO, QUE_NODE_UPDATE, and QUE_NODE_WHILE.
Referenced by que_thr_step().
01115 : query graph node */ 01116 { 01117 ulint type; 01118 const char* str; 01119 01120 type = que_node_get_type(node); 01121 01122 if (type == QUE_NODE_SELECT) { 01123 str = "SELECT"; 01124 } else if (type == QUE_NODE_INSERT) { 01125 str = "INSERT"; 01126 } else if (type == QUE_NODE_UPDATE) { 01127 str = "UPDATE"; 01128 } else if (type == QUE_NODE_WHILE) { 01129 str = "WHILE"; 01130 } else if (type == QUE_NODE_ASSIGNMENT) { 01131 str = "ASSIGNMENT"; 01132 } else if (type == QUE_NODE_IF) { 01133 str = "IF"; 01134 } else if (type == QUE_NODE_FETCH) { 01135 str = "FETCH"; 01136 } else if (type == QUE_NODE_OPEN) { 01137 str = "OPEN"; 01138 } else if (type == QUE_NODE_PROC) { 01139 str = "STORED PROCEDURE"; 01140 } else if (type == QUE_NODE_FUNC) { 01141 str = "FUNCTION"; 01142 } else if (type == QUE_NODE_LOCK) { 01143 str = "LOCK"; 01144 } else if (type == QUE_NODE_THR) { 01145 str = "QUERY THREAD"; 01146 } else if (type == QUE_NODE_COMMIT) { 01147 str = "COMMIT"; 01148 } else if (type == QUE_NODE_UNDO) { 01149 str = "UNDO ROW"; 01150 } else if (type == QUE_NODE_PURGE) { 01151 str = "PURGE ROW"; 01152 } else if (type == QUE_NODE_ROLLBACK) { 01153 str = "ROLLBACK"; 01154 } else if (type == QUE_NODE_CREATE_TABLE) { 01155 str = "CREATE TABLE"; 01156 } else if (type == QUE_NODE_CREATE_INDEX) { 01157 str = "CREATE INDEX"; 01158 } else if (type == QUE_NODE_FOR) { 01159 str = "FOR LOOP"; 01160 } else if (type == QUE_NODE_RETURN) { 01161 str = "RETURN"; 01162 } else if (type == QUE_NODE_EXIT) { 01163 str = "EXIT"; 01164 } else { 01165 str = "UNKNOWN NODE TYPE"; 01166 } 01167 01168 fprintf(stderr, "Node type %lu: %s, address %p\n", (ulong) type, str, node); 01169 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE void que_node_set_parent | ( | que_node_t * | node, | |
| que_node_t * | parent | |||
| ) |
Referenced by pars_complete_graph_for_exec(), and row_ins_foreign_check_on_constraint().
Here is the caller graph for this function:

| UNIV_INLINE void que_node_set_val_buf_size | ( | que_node_t * | node, | |
| ulint | size | |||
| ) |
Referenced by eval_node_alloc_val_buf(), sel_pop_prefetched_row(), and sel_push_prefetched_row().
Here is the caller graph for this function:

| void que_run_threads | ( | que_thr_t * | thr | ) |
Definition at line 1360 of file que0que.c.
References DB_SUCCESS, kernel_mutex, mutex_enter, mutex_exit(), NULL, que_run_threads_low(), QUE_THR_COMMAND_WAIT, QUE_THR_COMPLETED, que_thr_dec_refer_count(), QUE_THR_LOCK_WAIT, QUE_THR_RUNNING, srv_suspend_mysql_thread(), que_thr_struct::state, thr_get_trx(), ut_a, and ut_error.
Referenced by que_eval_sql(), row_create_index_for_mysql(), row_create_table_for_mysql(), srv_que_task_queue_check(), trx_general_rollback_for_mysql(), trx_purge(), and trx_rollback_or_clean_all_without_sess().
01362 : query thread */ 01363 { 01364 loop: 01365 ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS); 01366 que_run_threads_low(thr); 01367 01368 mutex_enter(&kernel_mutex); 01369 01370 switch (thr->state) { 01371 01372 case QUE_THR_RUNNING: 01373 /* There probably was a lock wait, but it already ended 01374 before we came here: continue running thr */ 01375 01376 mutex_exit(&kernel_mutex); 01377 01378 goto loop; 01379 01380 case QUE_THR_LOCK_WAIT: 01381 mutex_exit(&kernel_mutex); 01382 01383 /* The ..._mysql_... function works also for InnoDB's 01384 internal threads. Let us wait that the lock wait ends. */ 01385 01386 srv_suspend_mysql_thread(thr); 01387 01388 if (thr_get_trx(thr)->error_state != DB_SUCCESS) { 01389 /* thr was chosen as a deadlock victim or there was 01390 a lock wait timeout */ 01391 01392 que_thr_dec_refer_count(thr, NULL); 01393 01394 return; 01395 } 01396 01397 goto loop; 01398 01399 case QUE_THR_COMPLETED: 01400 case QUE_THR_COMMAND_WAIT: 01401 /* Do nothing */ 01402 break; 01403 01404 default: 01405 ut_error; 01406 } 01407 01408 mutex_exit(&kernel_mutex); 01409 }
Here is the call graph for this function:

Here is the caller graph for this function:

| que_thr_t* que_thr_create | ( | que_fork_t * | parent, | |
| mem_heap_t * | heap | |||
| ) |
Definition at line 187 of file que0que.c.
References que_thr_struct::common, FALSE, que_thr_struct::graph, que_fork_struct::graph, que_thr_struct::is_active, que_thr_struct::lock_state, que_thr_struct::magic_n, mem_heap_alloc(), NULL, que_common_struct::parent, QUE_NODE_THR, QUE_THR_COMMAND_WAIT, QUE_THR_LOCK_NOLOCK, QUE_THR_MAGIC_N, que_thr_struct::resource, que_thr_struct::run_node, que_thr_struct::state, que_fork_struct::thrs, que_common_struct::type, ut_ad, and UT_LIST_ADD_LAST.
Referenced by pars_complete_graph_for_exec(), pars_procedure_definition(), trx_purge_graph_build(), trx_roll_graph_build(), and trx_rollback_or_clean_all_without_sess().
00189 : query thread node */ 00190 que_fork_t* parent, /* in: parent node, i.e., a fork node */ 00191 mem_heap_t* heap) /* in: memory heap where created */ 00192 { 00193 que_thr_t* thr; 00194 00195 ut_ad(parent && heap); 00196 00197 thr = mem_heap_alloc(heap, sizeof(que_thr_t)); 00198 00199 thr->common.type = QUE_NODE_THR; 00200 thr->common.parent = parent; 00201 00202 thr->magic_n = QUE_THR_MAGIC_N; 00203 00204 thr->graph = parent->graph; 00205 00206 thr->state = QUE_THR_COMMAND_WAIT; 00207 00208 thr->is_active = FALSE; 00209 00210 thr->run_node = NULL; 00211 thr->resource = 0; 00212 thr->lock_state = QUE_THR_LOCK_NOLOCK; 00213 00214 UT_LIST_ADD_LAST(thrs, parent->thrs, thr); 00215 00216 return(thr); 00217 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 226 of file que0que.c.
References que_thr_struct::is_active, kernel_mutex, NULL, que_thr_struct::prev_node, QUE_THR_LOCK_WAIT, que_thr_move_to_run_state(), QUE_THR_PROCEDURE_WAIT, QUE_THR_SIG_REPLY_WAIT, que_thr_struct::run_node, srv_que_task_enqueue_low(), que_thr_struct::state, ut_a, and ut_ad.
Referenced by trx_sig_reply().
00228 : query thread in the 00229 QUE_THR_LOCK_WAIT, 00230 or QUE_THR_PROCEDURE_WAIT, or 00231 QUE_THR_SIG_REPLY_WAIT state */ 00232 que_thr_t** next_thr) /* in/out: next query thread to run; 00233 if the value which is passed in is 00234 a pointer to a NULL pointer, then the 00235 calling function can start running 00236 a new query thread; if NULL is passed 00237 as the parameter, it is ignored */ 00238 { 00239 ibool was_active; 00240 00241 #ifdef UNIV_SYNC_DEBUG 00242 ut_ad(mutex_own(&kernel_mutex)); 00243 #endif /* UNIV_SYNC_DEBUG */ 00244 ut_ad(thr); 00245 ut_ad((thr->state == QUE_THR_LOCK_WAIT) 00246 || (thr->state == QUE_THR_PROCEDURE_WAIT) 00247 || (thr->state == QUE_THR_SIG_REPLY_WAIT)); 00248 ut_ad(thr->run_node); 00249 00250 thr->prev_node = thr->run_node; 00251 00252 was_active = thr->is_active; 00253 00254 que_thr_move_to_run_state(thr); 00255 00256 if (was_active) { 00257 00258 return; 00259 } 00260 00261 if (next_thr && *next_thr == NULL) { 00262 *next_thr = thr; 00263 } else { 00264 ut_a(0); 00265 srv_que_task_enqueue_low(thr); 00266 } 00267 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void que_thr_end_wait_no_next_thr | ( | que_thr_t * | thr | ) |
Definition at line 273 of file que0que.c.
References que_thr_struct::is_active, kernel_mutex, QUE_THR_LOCK_WAIT, que_thr_move_to_run_state(), QUE_THR_PROCEDURE_WAIT, QUE_THR_SIG_REPLY_WAIT, srv_release_mysql_thread_if_suspended(), que_thr_struct::state, ut_a, and ut_ad.
Referenced by trx_end_lock_wait().
00275 : query thread in the QUE_THR_LOCK_WAIT, 00276 or QUE_THR_PROCEDURE_WAIT, or 00277 QUE_THR_SIG_REPLY_WAIT state */ 00278 { 00279 ibool was_active; 00280 00281 ut_a(thr->state == QUE_THR_LOCK_WAIT); /* In MySQL this is the 00282 only possible state here */ 00283 #ifdef UNIV_SYNC_DEBUG 00284 ut_ad(mutex_own(&kernel_mutex)); 00285 #endif /* UNIV_SYNC_DEBUG */ 00286 ut_ad(thr); 00287 ut_ad((thr->state == QUE_THR_LOCK_WAIT) 00288 || (thr->state == QUE_THR_PROCEDURE_WAIT) 00289 || (thr->state == QUE_THR_SIG_REPLY_WAIT)); 00290 00291 was_active = thr->is_active; 00292 00293 que_thr_move_to_run_state(thr); 00294 00295 if (was_active) { 00296 00297 return; 00298 } 00299 00300 /* In MySQL we let the OS thread (not just the query thread) to wait 00301 for the lock to be released: */ 00302 00303 srv_release_mysql_thread_if_suspended(thr); 00304 00305 /* srv_que_task_enqueue_low(thr); */ 00306 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1018 of file que0que.c.
References que_thr_struct::graph, que_thr_struct::is_active, que_thr_struct::magic_n, mem_analyze_corruption(), que_fork_struct::n_active_thrs, trx_struct::n_active_thrs, QUE_THR_MAGIC_N, QUE_THR_RUNNING, que_thr_struct::state, TRUE, and ut_error.
Referenced by row_insert_for_mysql(), row_lock_table_autoinc_for_mysql(), row_lock_table_for_mysql(), row_search_for_mysql(), and row_update_for_mysql().
01020 : an query thread */ 01021 trx_t* trx) /* in: transaction */ 01022 { 01023 if (thr->magic_n != QUE_THR_MAGIC_N) { 01024 fprintf(stderr, 01025 "que_thr struct appears corrupt; magic n %lu\n", 01026 (unsigned long) thr->magic_n); 01027 01028 mem_analyze_corruption(thr); 01029 01030 ut_error; 01031 } 01032 01033 if (!thr->is_active) { 01034 01035 thr->graph->n_active_thrs++; 01036 01037 trx->n_active_thrs++; 01038 01039 thr->is_active = TRUE; 01040 } 01041 01042 thr->state = QUE_THR_RUNNING; 01043 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE ibool que_thr_peek_stop | ( | que_thr_t * | thr | ) |
| ibool que_thr_stop | ( | que_thr_t * | thr | ) |
Definition at line 922 of file que0que.c.
References DB_LOCK_WAIT, DB_SUCCESS, trx_struct::error_state, FALSE, que_fork_struct::fork_type, que_thr_struct::graph, kernel_mutex, QUE_FORK_ACTIVE, QUE_FORK_COMMAND_WAIT, QUE_FORK_ROLLBACK, trx_struct::que_state, QUE_THR_COMPLETED, QUE_THR_LOCK_WAIT, QUE_THR_SUSPENDED, trx_struct::signals, que_fork_struct::state, que_thr_struct::state, TRUE, que_fork_struct::trx, TRX_QUE_LOCK_WAIT, ut_ad, UT_LIST_ADD_FIRST, UT_LIST_GET_LEN, and trx_struct::wait_thrs.
Referenced by lock_rec_enqueue_waiting(), lock_table_enqueue_waiting(), and que_thr_dec_refer_count().
00924 : TRUE if stopped */ 00925 que_thr_t* thr) /* in: query thread */ 00926 { 00927 trx_t* trx; 00928 que_t* graph; 00929 ibool ret = TRUE; 00930 00931 #ifdef UNIV_SYNC_DEBUG 00932 ut_ad(mutex_own(&kernel_mutex)); 00933 #endif /* UNIV_SYNC_DEBUG */ 00934 00935 graph = thr->graph; 00936 trx = graph->trx; 00937 00938 if (graph->state == QUE_FORK_COMMAND_WAIT) { 00939 thr->state = QUE_THR_SUSPENDED; 00940 00941 } else if (trx->que_state == TRX_QUE_LOCK_WAIT) { 00942 00943 UT_LIST_ADD_FIRST(trx_thrs, trx->wait_thrs, thr); 00944 thr->state = QUE_THR_LOCK_WAIT; 00945 00946 } else if (trx->error_state != DB_SUCCESS 00947 && trx->error_state != DB_LOCK_WAIT) { 00948 00949 /* Error handling built for the MySQL interface */ 00950 thr->state = QUE_THR_COMPLETED; 00951 00952 } else if (UT_LIST_GET_LEN(trx->signals) > 0 00953 && graph->fork_type != QUE_FORK_ROLLBACK) { 00954 00955 thr->state = QUE_THR_SUSPENDED; 00956 } else { 00957 ut_ad(graph->state == QUE_FORK_ACTIVE); 00958 00959 ret = FALSE; 00960 } 00961 00962 return(ret); 00963 }
Here is the caller graph for this function:

| void que_thr_stop_for_mysql | ( | que_thr_t * | thr | ) |
Definition at line 972 of file que0que.c.
References DB_LOCK_WAIT, DB_SUCCESS, trx_struct::error_state, FALSE, que_thr_struct::graph, que_thr_struct::is_active, kernel_mutex, mutex_enter, mutex_exit(), trx_struct::n_active_thrs, que_fork_struct::n_active_thrs, QUE_THR_COMPLETED, QUE_THR_RUNNING, que_thr_struct::state, thr_get_trx(), TRUE, and ut_ad.
Referenced by row_insert_for_mysql(), row_lock_table_autoinc_for_mysql(), row_lock_table_for_mysql(), row_mysql_handle_errors(), row_search_for_mysql(), row_update_cascade_for_mysql(), and row_update_for_mysql().
00974 : query thread */ 00975 { 00976 trx_t* trx; 00977 00978 trx = thr_get_trx(thr); 00979 00980 mutex_enter(&kernel_mutex); 00981 00982 if (thr->state == QUE_THR_RUNNING) { 00983 00984 if (trx->error_state != DB_SUCCESS 00985 && trx->error_state != DB_LOCK_WAIT) { 00986 00987 /* Error handling built for the MySQL interface */ 00988 thr->state = QUE_THR_COMPLETED; 00989 } else { 00990 /* It must have been a lock wait but the lock was 00991 already released, or this transaction was chosen 00992 as a victim in selective deadlock resolution */ 00993 00994 mutex_exit(&kernel_mutex); 00995 00996 return; 00997 } 00998 } 00999 01000 ut_ad(thr->is_active == TRUE); 01001 ut_ad(trx->n_active_thrs == 1); 01002 ut_ad(thr->graph->n_active_thrs == 1); 01003 01004 thr->is_active = FALSE; 01005 (thr->graph)->n_active_thrs--; 01006 01007 trx->n_active_thrs--; 01008 01009 mutex_exit(&kernel_mutex); 01010 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1050 of file que0que.c.
References FALSE, que_thr_struct::graph, que_thr_struct::is_active, que_thr_struct::magic_n, mem_analyze_corruption(), trx_struct::n_active_thrs, que_fork_struct::n_active_thrs, QUE_THR_COMPLETED, QUE_THR_MAGIC_N, QUE_THR_RUNNING, que_thr_struct::state, TRUE, ut_ad, and ut_error.
Referenced by row_insert_for_mysql(), row_lock_table_autoinc_for_mysql(), row_lock_table_for_mysql(), row_search_for_mysql(), and row_update_for_mysql().
01052 : query thread */ 01053 trx_t* trx) /* in: transaction */ 01054 { 01055 ut_ad(thr->state == QUE_THR_RUNNING); 01056 ut_ad(thr->is_active == TRUE); 01057 ut_ad(trx->n_active_thrs == 1); 01058 ut_ad(thr->graph->n_active_thrs == 1); 01059 01060 if (thr->magic_n != QUE_THR_MAGIC_N) { 01061 fprintf(stderr, 01062 "que_thr struct appears corrupt; magic n %lu\n", 01063 (unsigned long) thr->magic_n); 01064 01065 mem_analyze_corruption(thr); 01066 01067 ut_error; 01068 } 01069 01070 thr->state = QUE_THR_COMPLETED; 01071 01072 thr->is_active = FALSE; 01073 (thr->graph)->n_active_thrs--; 01074 01075 trx->n_active_thrs--; 01076 }
Here is the call graph for this function:

Here is the caller graph for this function:

Referenced by btr_cur_del_mark_set_clust_rec(), btr_cur_del_mark_set_sec_rec(), btr_cur_optimistic_insert(), btr_cur_optimistic_update(), btr_cur_pessimistic_update(), btr_cur_update_in_place(), dict_build_index_def_step(), dict_build_table_def_step(), dict_create_index_step(), dict_create_table_step(), fetch_step(), ibuf_insert_low(), lock_clust_rec_modify_check_and_lock(), lock_clust_rec_read_check_and_lock(), lock_rec_enqueue_waiting(), lock_rec_insert_check_and_lock(), lock_rec_lock(), lock_rec_lock_fast(), lock_rec_lock_slow(), lock_sec_rec_modify_check_and_lock(), lock_sec_rec_read_check_and_lock(), lock_table(), lock_table_enqueue_waiting(), que_run_threads(), que_run_threads_low(), que_thr_dec_refer_count(), que_thr_move_to_run_state(), que_thr_step(), que_thr_stop_for_mysql(), row_ins_check_foreign_constraint(), row_ins_check_foreign_constraints(), row_ins_clust_index_entry_by_modify(), row_ins_duplicate_error_in_clust(), row_ins_foreign_check_on_constraint(), row_ins_foreign_report_err(), row_ins_index_entry_low(), row_ins_invalidate_query_cache(), row_ins_scan_sec_index_for_duplicate(), row_ins_sec_index_entry_by_modify(), row_ins_step(), row_purge(), row_purge_parse_undo_rec(), row_sel(), row_sel_get_clust_rec(), row_sel_get_clust_rec_for_mysql(), row_sel_step(), row_undo_mod_del_unmark_sec_and_undo_update(), row_undo_mod_parse_undo_rec(), row_undo_step(), row_upd_check_references_constraints(), row_upd_clust_rec_by_insert(), row_upd_clust_step(), row_upd_sec_index_entry(), row_upd_step(), row_update_cascade_for_mysql(), sel_set_rec_lock(), srv_lock_timeout_and_monitor_thread(), srv_suspend_mysql_thread(), trx_commit_step(), trx_rollback_step(), trx_sig_reply(), trx_sig_send(), and trx_undo_report_row_operation().
Here is the caller graph for this function:

| ibool que_trace_on |
1.4.7

