MySQL 5.6.14 Source Code Document
|
#include "que0que.h"
#include "usr0sess.h"
#include "trx0trx.h"
#include "trx0roll.h"
#include "row0undo.h"
#include "row0ins.h"
#include "row0upd.h"
#include "row0sel.h"
#include "row0purge.h"
#include "dict0crea.h"
#include "log0log.h"
#include "eval0proc.h"
#include "lock0lock.h"
#include "eval0eval.h"
#include "pars0types.h"
Go to the source code of this file.
Macros | |
#define | QUE_MAX_LOOPS_WITHOUT_CHECK 16 |
UNIV_INTERN void que_close | ( | void | ) |
Close the query sub-system.
Definition at line 1314 of file que0que.cc.
UNIV_INTERN dberr_t que_eval_sql | ( | pars_info_t * | info, |
const char * | sql, | ||
ibool | reserve_dict_mutex, | ||
trx_t * | trx | ||
) |
Evaluate the given SQL.
info | in: info struct, or NULL |
sql | in: SQL string |
reserve_dict_mutex | in: if TRUE, acquire/release dict_sys->mutex around call to pars_sql. |
trx | in: trx |
Definition at line 1252 of file que0que.cc.
UNIV_INLINE ibool que_fork_all_thrs_in_state | ( | que_fork_t * | fork, |
ulint | state | ||
) |
Tests if all the query threads in the same fork have a given state.
fork | in: query fork |
state | in: state |
Definition at line 389 of file que0que.cc.
UNIV_INTERN que_fork_t* que_fork_create | ( | que_t * | graph, |
que_node_t * | parent, | ||
ulint | fork_type, | ||
mem_heap_t * | heap | ||
) |
Creates a query graph fork node.
graph | in: graph, if NULL then this fork node is assumed to be the graph root |
parent | in: parent node |
fork_type | in: fork type |
heap | in: memory heap where created |
Definition at line 129 of file que0que.cc.
UNIV_INTERN que_thr_t* que_fork_scheduler_round_robin | ( | que_fork_t * | fork, |
que_thr_t * | thr | ||
) |
Round robin scheduler.
fork | in: a query fork |
thr | in: current pos |
Definition at line 254 of file que0que.cc.
UNIV_INTERN que_thr_t* que_fork_start_command | ( | que_fork_t * | fork | ) |
Starts execution of a command in a query fork. Picks a query thread which is not in the QUE_THR_RUNNING state and moves it to that state. If none can be chosen, a situation which may arise in parallelized fetches, NULL is returned.
fork | in: a query fork |
Definition at line 304 of file que0que.cc.
UNIV_INTERN void que_graph_free | ( | que_t * | graph | ) |
Frees a query graph.
graph | in: query graph; we assume that the memory heap where this graph was created is private to this graph: if not, then use que_graph_free_recursive and free the heap afterwards! |
Definition at line 600 of file que0que.cc.
UNIV_INTERN void que_graph_free_recursive | ( | que_node_t * | node | ) |
Frees a query graph, but not the heap where it was created. Does not free explicit cursor declarations, they are freed in que_graph_free.
node | in: query graph node |
Definition at line 429 of file que0que.cc.
UNIV_INTERN void que_init | ( | void | ) |
Initialise the query sub-system.
Definition at line 1304 of file que0que.cc.
UNIV_INTERN que_node_t* que_node_get_containing_loop_node | ( | que_node_t * | node | ) |
Get the first containing loop node (e.g. while_node_t or for_node_t) for the given node, or NULL if the node is not within a loop.
node | in: node |
Definition at line 928 of file que0que.cc.
UNIV_INTERN void que_node_print_info | ( | que_node_t * | node | ) |
Prints info of an SQL query graph node.
node | in: query graph node |
Definition at line 957 of file que0que.cc.
UNIV_INTERN void que_run_threads | ( | que_thr_t * | thr | ) |
Run a query thread. Handles lock waits.
thr | in: query thread |
Definition at line 1199 of file que0que.cc.
UNIV_INTERN que_thr_t* que_thr_create | ( | que_fork_t * | parent, |
mem_heap_t * | heap | ||
) |
Creates a query graph thread node.
parent | in: parent node, i.e., a fork node |
heap | in: memory heap where created |
Definition at line 164 of file que0que.cc.
Moves a suspended query thread to the QUE_THR_RUNNING state and may release a worker thread to execute it. This function should be used to end the wait state of a query thread waiting for a lock or a stored procedure completion.
trx | in: transaction with que_state in QUE_THR_LOCK_WAIT |
Definition at line 200 of file que0que.cc.
UNIV_INLINE void que_thr_init_command | ( | que_thr_t * | thr | ) |
Inits a query thread for a command.
thr | in: query thread |
Definition at line 237 of file que0que.cc.
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.
thr | in: an query thread |
trx | in: transaction |
Definition at line 861 of file que0que.cc.
Performs an execution step on a query thread.
thr | in: query thread |
Definition at line 1022 of file que0que.cc.
UNIV_INTERN ibool que_thr_stop | ( | que_thr_t * | thr | ) |
Stops a query thread if graph or trx is in a state requiring it. The conditions are tested in the order (1) graph, (2) trx.
thr | in: query thread |
Definition at line 701 of file que0que.cc.
UNIV_INTERN void que_thr_stop_for_mysql | ( | que_thr_t * | thr | ) |
A patch for MySQL used to 'stop' a dummy query thread used in MySQL. The query thread is stopped and made inactive, except in the case where it was put to the lock wait state in lock0lock.cc, but the lock has already been granted or the transaction chosen as a victim in deadlock resolution.
thr | in: query thread |
Definition at line 812 of file que0que.cc.
A patch for MySQL used to 'stop' a dummy query thread used in MySQL select, when there is no error or lock wait.
thr | in: query thread |
trx | in: transaction |
Definition at line 893 of file que0que.cc.