InnoDB Plugin
1.0
|
#include "univ.i"
#include "data0data.h"
#include "dict0types.h"
#include "trx0trx.h"
#include "trx0roll.h"
#include "srv0srv.h"
#include "usr0types.h"
#include "que0types.h"
#include "row0types.h"
#include "pars0types.h"
#include "que0que.ic"
Go to the source code of this file.
Data Structures | |
struct | que_thr_t |
struct | que_fork_t |
Functions | |
UNIV_INTERN que_fork_t * | que_fork_create (que_t *graph, que_node_t *parent, ulint fork_type, mem_heap_t *heap) |
UNIV_INLINE que_thr_t * | que_fork_get_first_thr (que_fork_t *fork) |
UNIV_INLINE que_node_t * | que_fork_get_child (que_fork_t *fork) |
UNIV_INLINE void | que_node_set_parent (que_node_t *node, que_node_t *parent) |
UNIV_INTERN que_thr_t * | que_thr_create (que_fork_t *parent, mem_heap_t *heap) |
UNIV_INTERN void | que_graph_free_recursive (que_node_t *node) |
UNIV_INTERN void | que_graph_free (que_t *graph) |
UNIV_INTERN ibool | que_thr_stop (que_thr_t *thr) |
UNIV_INTERN void | que_thr_move_to_run_state_for_mysql (que_thr_t *thr, trx_t *trx) |
UNIV_INTERN void | que_thr_stop_for_mysql_no_error (que_thr_t *thr, trx_t *trx) |
UNIV_INTERN void | que_thr_stop_for_mysql (que_thr_t *thr) |
UNIV_INTERN void | que_run_threads (que_thr_t *thr) |
UNIV_INTERN que_thr_t * | que_thr_end_lock_wait (trx_t *trx) |
UNIV_INTERN que_thr_t * | que_fork_start_command (que_fork_t *fork) |
UNIV_INLINE trx_t * | thr_get_trx (que_thr_t *thr) |
UNIV_INLINE ibool | thr_is_recv (const que_thr_t *thr) |
UNIV_INLINE ulint | que_node_get_type (que_node_t *node) |
UNIV_INLINE dtype_t * | que_node_get_data_type (que_node_t *node) |
UNIV_INLINE dfield_t * | que_node_get_val (que_node_t *node) |
UNIV_INLINE ulint | que_node_get_val_buf_size (que_node_t *node) |
UNIV_INLINE void | que_node_set_val_buf_size (que_node_t *node, ulint size) |
UNIV_INLINE que_node_t * | que_node_get_next (que_node_t *node) |
UNIV_INLINE que_node_t * | que_node_get_parent (que_node_t *node) |
UNIV_INTERN que_node_t * | que_node_get_containing_loop_node (que_node_t *node) |
UNIV_INLINE que_node_t * | que_node_list_add_last (que_node_t *node_list, que_node_t *node) |
UNIV_INLINE que_node_t * | que_node_list_get_last (que_node_t *node_list) |
UNIV_INLINE ulint | que_node_list_get_len (que_node_t *node_list) |
UNIV_INLINE ibool | que_thr_peek_stop (que_thr_t *thr) |
UNIV_INLINE ibool | que_graph_is_select (que_t *graph) |
UNIV_INTERN void | que_node_print_info (que_node_t *node) |
UNIV_INTERN dberr_t | que_eval_sql (pars_info_t *info, const char *sql, ibool reserve_dict_mutex, trx_t *trx) |
UNIV_INTERN que_thr_t * | que_fork_scheduler_round_robin (que_fork_t *fork, que_thr_t *thr) |
UNIV_INTERN void | que_init (void) |
UNIV_INTERN void | que_close (void) |
Variables | |
ibool | que_trace_on |
ib_mutex_t | que_thr_mutex |
Query graph
Created 5/27/1996 Heikki Tuuri
#define QUE_THR_COMPLETED |
UNIV_INTERN void que_close | ( | void | ) |
Close the query sub-system.
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. |
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 |
UNIV_INLINE que_node_t* que_fork_get_child | ( | que_fork_t * | fork | ) |
Gets the child node of the first thr in a fork. in: query fork
Gets the child node of the first thr in a fork.
fork | in: query fork |
UNIV_INLINE que_thr_t* que_fork_get_first_thr | ( | que_fork_t * | fork | ) |
Gets the first thr in a fork. in: query fork
Gets the first thr in a fork.
fork | in: query fork |
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 |
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.
UNIV_INTERN void que_graph_free | ( | que_t * | graph | ) |
Frees a query 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!
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. in: query graph node
Returns TRUE if the query graph is for a SELECT statement.
Returns TRUE if the query graph is for a SELECT statement.
graph | in: graph |
UNIV_INTERN void que_init | ( | void | ) |
Initialise the query sub-system.
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.
UNIV_INLINE dtype_t* que_node_get_data_type | ( | que_node_t * | node | ) |
Gets pointer to the value data type field of a graph node. in: graph node
Gets pointer to the value data type field of a graph node.
node | in: graph node |
UNIV_INLINE que_node_t* que_node_get_next | ( | que_node_t * | node | ) |
Gets the next list node in a list of query graph nodes. in: node in a list
Gets the next list node in a list of query graph nodes.
node | in: node in a list |
UNIV_INLINE que_node_t* que_node_get_parent | ( | que_node_t * | node | ) |
Gets the parent node of a query graph node.
Gets the parent node of a query graph node.
node | in: node |
UNIV_INLINE ulint que_node_get_type | ( | que_node_t * | node | ) |
Gets the type of a graph node. in: graph node
Gets the type of a graph node.
node | in: graph node |
UNIV_INLINE dfield_t* que_node_get_val | ( | que_node_t * | node | ) |
Gets pointer to the value dfield of a graph node. in: graph node
Gets pointer to the value dfield of a graph node.
node | in: graph node |
UNIV_INLINE ulint que_node_get_val_buf_size | ( | que_node_t * | node | ) |
Gets the value buffer size of a graph node.
Gets the value buffer size of a graph node.
node | in: graph node |
UNIV_INLINE que_node_t* que_node_list_add_last | ( | que_node_t * | node_list, |
que_node_t * | node | ||
) |
Catenates a query graph node to a list of them, possible empty list.
Catenates a query graph node to a list of them, possible empty list.
node_list | in: node list, or NULL |
node | in: node |
UNIV_INLINE ulint que_node_list_get_len | ( | que_node_t * | node_list | ) |
Gets a query graph node list length.
Gets a query graph node list length.
node_list | in: node list, or NULL |
UNIV_INTERN void que_node_print_info | ( | que_node_t * | node | ) |
Prints info of an SQL query graph node. in: query graph node
UNIV_INLINE void que_node_set_parent | ( | que_node_t * | node, |
que_node_t * | parent | ||
) |
Sets the parent of a graph node. in: parent
Sets the parent of a graph node.
node | in: graph node |
parent | in: parent |
UNIV_INLINE void que_node_set_val_buf_size | ( | que_node_t * | node, |
ulint | size | ||
) |
Sets the value buffer size of a graph node. in: size
Sets the value buffer size of a graph node.
node | in: graph node |
size | in: size |
UNIV_INTERN void que_run_threads | ( | que_thr_t * | thr | ) |
Run a query thread. Handles lock waits. in: query thread
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 |
Moves a suspended query thread to the QUE_THR_RUNNING state and 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.
Moves a thread from another state to the QUE_THR_RUNNING state. Increments the n_active_thrs counters of the query graph and transaction. in: transaction
thr | in: an query thread |
Checks if graph, trx, or session is in a state where the query thread should be stopped.
Checks if graph, trx, or session is in a state where the query thread should be stopped.
thr | in: query thread |
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. The lock_sys_t::mutex has to be reserved.
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. in: query thread
A patch for MySQL used to 'stop' a dummy query thread used in MySQL select, when there is no error or lock wait. in: transaction
thr | in: query thread |
Gets the trx of a query thread. in: query thread
Gets the trx of a query thread.
thr | in: query thread |
Determines if this thread is rolling back an incomplete transaction in crash recovery.
Determines if this thread is rolling back an incomplete transaction in crash recovery.
thr | in: query thread |
ib_mutex_t que_thr_mutex |
Mutex protecting the query threads.