drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
que0que.h File Reference
#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 dependency graph for que0que.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  que_thr_struct
struct  que_fork_struct

Macros

#define que0que_h
#define QUE_THR_MAGIC_N   8476583
#define QUE_THR_MAGIC_FREED   123461526
#define QUE_FORK_SELECT_NON_SCROLL   1 /* forward-only cursor */
#define QUE_FORK_SELECT_SCROLL   2 /* scrollable cursor */
#define QUE_FORK_INSERT   3
#define QUE_FORK_UPDATE   4
#define QUE_FORK_ROLLBACK   5
#define QUE_FORK_PURGE   6
#define QUE_FORK_EXECUTE   7
#define QUE_FORK_PROCEDURE   8
#define QUE_FORK_PROCEDURE_CALL   9
#define QUE_FORK_MYSQL_INTERFACE   10
#define QUE_FORK_RECOVERY   11
#define QUE_FORK_ACTIVE   1
#define QUE_FORK_COMMAND_WAIT   2
#define QUE_FORK_INVALID   3
#define QUE_FORK_BEING_FREED   4
#define QUE_NODE_CONTROL_STAT   1024
#define QUE_NODE_LOCK   1
#define QUE_NODE_INSERT   2
#define QUE_NODE_UPDATE   4
#define QUE_NODE_CURSOR   5
#define QUE_NODE_SELECT   6
#define QUE_NODE_AGGREGATE   7
#define QUE_NODE_FORK   8
#define QUE_NODE_THR   9
#define QUE_NODE_UNDO   10
#define QUE_NODE_COMMIT   11
#define QUE_NODE_ROLLBACK   12
#define QUE_NODE_PURGE   13
#define QUE_NODE_CREATE_TABLE   14
#define QUE_NODE_CREATE_INDEX   15
#define QUE_NODE_SYMBOL   16
#define QUE_NODE_RES_WORD   17
#define QUE_NODE_FUNC   18
#define QUE_NODE_ORDER   19
#define QUE_NODE_PROC   (20 + QUE_NODE_CONTROL_STAT)
#define QUE_NODE_IF   (21 + QUE_NODE_CONTROL_STAT)
#define QUE_NODE_WHILE   (22 + QUE_NODE_CONTROL_STAT)
#define QUE_NODE_ASSIGNMENT   23
#define QUE_NODE_FETCH   24
#define QUE_NODE_OPEN   25
#define QUE_NODE_COL_ASSIGNMENT   26
#define QUE_NODE_FOR   (27 + QUE_NODE_CONTROL_STAT)
#define QUE_NODE_RETURN   28
#define QUE_NODE_ROW_PRINTF   29
#define QUE_NODE_ELSIF   30
#define QUE_NODE_CALL   31
#define QUE_NODE_EXIT   32
#define QUE_THR_RUNNING   1
#define QUE_THR_PROCEDURE_WAIT   2
#define QUE_THR_COMPLETED
#define QUE_THR_COMMAND_WAIT   4
#define QUE_THR_LOCK_WAIT   5
#define QUE_THR_SIG_REPLY_WAIT   6
#define QUE_THR_SUSPENDED   7
#define QUE_THR_ERROR   8
#define QUE_THR_LOCK_NOLOCK   0
#define QUE_THR_LOCK_ROW   1
#define QUE_THR_LOCK_TABLE   2
#define QUE_CUR_NOT_DEFINED   1
#define QUE_CUR_START   2
#define QUE_CUR_END   3

Functions

UNIV_INTERN void que_graph_publish (que_t *graph, sess_t *sess)
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 void que_fork_error_handle (trx_t *trx, que_t *fork)
UNIV_INTERN void que_thr_end_wait (que_thr_t *thr, que_thr_t **next_thr)
UNIV_INTERN void que_thr_end_wait_no_next_thr (que_thr_t *thr)
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 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 ulint que_eval_sql (pars_info_t *info, const char *sql, ibool reserve_dict_mutex, trx_t *trx)

Variables

ibool que_trace_on

Detailed Description

Query graph

Created 5/27/1996 Heikki Tuuri

Definition in file que0que.h.

Macro Definition Documentation

◆ que0que_h

#define que0que_h

Definition at line 28 of file que0que.h.

◆ QUE_CUR_END

#define QUE_CUR_END   3

Definition at line 514 of file que0que.h.

◆ QUE_CUR_NOT_DEFINED

#define QUE_CUR_NOT_DEFINED   1

Definition at line 512 of file que0que.h.

◆ QUE_CUR_START

#define QUE_CUR_START   2

Definition at line 513 of file que0que.h.

◆ QUE_FORK_ACTIVE

#define QUE_FORK_ACTIVE   1

Definition at line 455 of file que0que.h.

◆ QUE_FORK_BEING_FREED

#define QUE_FORK_BEING_FREED   4

Definition at line 458 of file que0que.h.

◆ QUE_FORK_COMMAND_WAIT

#define QUE_FORK_COMMAND_WAIT   2

Definition at line 456 of file que0que.h.

◆ QUE_FORK_EXECUTE

#define QUE_FORK_EXECUTE   7

Definition at line 448 of file que0que.h.

◆ QUE_FORK_INSERT

#define QUE_FORK_INSERT   3

Definition at line 442 of file que0que.h.

◆ QUE_FORK_INVALID

#define QUE_FORK_INVALID   3

Definition at line 457 of file que0que.h.

◆ QUE_FORK_MYSQL_INTERFACE

#define QUE_FORK_MYSQL_INTERFACE   10

Definition at line 451 of file que0que.h.

◆ QUE_FORK_PROCEDURE

#define QUE_FORK_PROCEDURE   8

Definition at line 449 of file que0que.h.

◆ QUE_FORK_PROCEDURE_CALL

#define QUE_FORK_PROCEDURE_CALL   9

Definition at line 450 of file que0que.h.

◆ QUE_FORK_PURGE

#define QUE_FORK_PURGE   6

Definition at line 447 of file que0que.h.

◆ QUE_FORK_RECOVERY

#define QUE_FORK_RECOVERY   11

Definition at line 452 of file que0que.h.

◆ QUE_FORK_ROLLBACK

#define QUE_FORK_ROLLBACK   5

Definition at line 444 of file que0que.h.

◆ QUE_FORK_SELECT_NON_SCROLL

#define QUE_FORK_SELECT_NON_SCROLL   1 /* forward-only cursor */

Definition at line 440 of file que0que.h.

◆ QUE_FORK_SELECT_SCROLL

#define QUE_FORK_SELECT_SCROLL   2 /* scrollable cursor */

Definition at line 441 of file que0que.h.

◆ QUE_FORK_UPDATE

#define QUE_FORK_UPDATE   4

Definition at line 443 of file que0que.h.

◆ QUE_NODE_AGGREGATE

#define QUE_NODE_AGGREGATE   7

Definition at line 469 of file que0que.h.

◆ QUE_NODE_ASSIGNMENT

#define QUE_NODE_ASSIGNMENT   23

Definition at line 485 of file que0que.h.

◆ QUE_NODE_CALL

#define QUE_NODE_CALL   31

Definition at line 493 of file que0que.h.

◆ QUE_NODE_COL_ASSIGNMENT

#define QUE_NODE_COL_ASSIGNMENT   26

Definition at line 488 of file que0que.h.

◆ QUE_NODE_COMMIT

#define QUE_NODE_COMMIT   11

Definition at line 473 of file que0que.h.

◆ QUE_NODE_CONTROL_STAT

#define QUE_NODE_CONTROL_STAT   1024

Definition at line 461 of file que0que.h.

◆ QUE_NODE_CREATE_INDEX

#define QUE_NODE_CREATE_INDEX   15

Definition at line 477 of file que0que.h.

◆ QUE_NODE_CREATE_TABLE

#define QUE_NODE_CREATE_TABLE   14

Definition at line 476 of file que0que.h.

◆ QUE_NODE_CURSOR

#define QUE_NODE_CURSOR   5

Definition at line 467 of file que0que.h.

◆ QUE_NODE_ELSIF

#define QUE_NODE_ELSIF   30

Definition at line 492 of file que0que.h.

◆ QUE_NODE_EXIT

#define QUE_NODE_EXIT   32

Definition at line 494 of file que0que.h.

◆ QUE_NODE_FETCH

#define QUE_NODE_FETCH   24

Definition at line 486 of file que0que.h.

◆ QUE_NODE_FOR

#define QUE_NODE_FOR   (27 + QUE_NODE_CONTROL_STAT)

Definition at line 489 of file que0que.h.

◆ QUE_NODE_FORK

#define QUE_NODE_FORK   8

Definition at line 470 of file que0que.h.

◆ QUE_NODE_FUNC

#define QUE_NODE_FUNC   18

Definition at line 480 of file que0que.h.

◆ QUE_NODE_IF

#define QUE_NODE_IF   (21 + QUE_NODE_CONTROL_STAT)

Definition at line 483 of file que0que.h.

◆ QUE_NODE_INSERT

#define QUE_NODE_INSERT   2

Definition at line 465 of file que0que.h.

◆ QUE_NODE_LOCK

#define QUE_NODE_LOCK   1

Definition at line 464 of file que0que.h.

◆ QUE_NODE_OPEN

#define QUE_NODE_OPEN   25

Definition at line 487 of file que0que.h.

◆ QUE_NODE_ORDER

#define QUE_NODE_ORDER   19

Definition at line 481 of file que0que.h.

◆ QUE_NODE_PROC

#define QUE_NODE_PROC   (20 + QUE_NODE_CONTROL_STAT)

Definition at line 482 of file que0que.h.

◆ QUE_NODE_PURGE

#define QUE_NODE_PURGE   13

Definition at line 475 of file que0que.h.

◆ QUE_NODE_RES_WORD

#define QUE_NODE_RES_WORD   17

Definition at line 479 of file que0que.h.

◆ QUE_NODE_RETURN

#define QUE_NODE_RETURN   28

Definition at line 490 of file que0que.h.

◆ QUE_NODE_ROLLBACK

#define QUE_NODE_ROLLBACK   12

Definition at line 474 of file que0que.h.

◆ QUE_NODE_ROW_PRINTF

#define QUE_NODE_ROW_PRINTF   29

Definition at line 491 of file que0que.h.

◆ QUE_NODE_SELECT

#define QUE_NODE_SELECT   6

Definition at line 468 of file que0que.h.

◆ QUE_NODE_SYMBOL

#define QUE_NODE_SYMBOL   16

Definition at line 478 of file que0que.h.

◆ QUE_NODE_THR

#define QUE_NODE_THR   9

Definition at line 471 of file que0que.h.

◆ QUE_NODE_UNDO

#define QUE_NODE_UNDO   10

Definition at line 472 of file que0que.h.

◆ QUE_NODE_UPDATE

#define QUE_NODE_UPDATE   4

Definition at line 466 of file que0que.h.

◆ QUE_NODE_WHILE

#define QUE_NODE_WHILE   (22 + QUE_NODE_CONTROL_STAT)

Definition at line 484 of file que0que.h.

◆ QUE_THR_COMMAND_WAIT

#define QUE_THR_COMMAND_WAIT   4

Definition at line 500 of file que0que.h.

◆ QUE_THR_COMPLETED

#define QUE_THR_COMPLETED
Value:
3 /* in selects this means that the
thread is at the end of its result set
(or start, in case of a scroll cursor);
in other statements, this means the
thread has done its task */

Definition at line 499 of file que0que.h.

◆ QUE_THR_ERROR

#define QUE_THR_ERROR   8

Definition at line 504 of file que0que.h.

◆ QUE_THR_LOCK_NOLOCK

#define QUE_THR_LOCK_NOLOCK   0

Definition at line 507 of file que0que.h.

◆ QUE_THR_LOCK_ROW

#define QUE_THR_LOCK_ROW   1

Definition at line 508 of file que0que.h.

◆ QUE_THR_LOCK_TABLE

#define QUE_THR_LOCK_TABLE   2

Definition at line 509 of file que0que.h.

◆ QUE_THR_LOCK_WAIT

#define QUE_THR_LOCK_WAIT   5

Definition at line 501 of file que0que.h.

◆ QUE_THR_MAGIC_FREED

#define QUE_THR_MAGIC_FREED   123461526

Definition at line 391 of file que0que.h.

◆ QUE_THR_MAGIC_N

#define QUE_THR_MAGIC_N   8476583

Definition at line 390 of file que0que.h.

◆ QUE_THR_PROCEDURE_WAIT

#define QUE_THR_PROCEDURE_WAIT   2

Definition at line 498 of file que0que.h.

◆ QUE_THR_RUNNING

#define QUE_THR_RUNNING   1

Definition at line 497 of file que0que.h.

◆ QUE_THR_SIG_REPLY_WAIT

#define QUE_THR_SIG_REPLY_WAIT   6

Definition at line 502 of file que0que.h.

◆ QUE_THR_SUSPENDED

#define QUE_THR_SUSPENDED   7

Definition at line 503 of file que0que.h.

Function Documentation

◆ que_eval_sql()

UNIV_INTERN ulint que_eval_sql ( pars_info_t * info,
const char * sql,
ibool reserve_dict_mutex,
trx_t * trx )

Evaluate the given SQL

Returns
error code or DB_SUCCESS in: trx

Evaluate the given SQL.

Returns
error code or DB_SUCCESS
Parameters
infoin: info struct, or NULL
sqlin: SQL string
reserve_dict_mutexin: if TRUE, acquire/release dict_sys->mutex around call to pars_sql.
trxin: trx

Definition at line 1384 of file que0que.cc.

◆ que_fork_create()

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.

Returns
own: fork node in: memory heap where created

Creates a query graph fork node.

Returns
own: fork node
Parameters
graphin: graph, if NULL then this fork node is assumed to be the graph root
parentin: parent node
fork_typein: fork type
heapin: memory heap where created

Definition at line 154 of file que0que.cc.

◆ que_fork_error_handle()

UNIV_INTERN void que_fork_error_handle ( trx_t * trx,
que_t * fork )

After signal handling is finished, returns control to a query graph error handling routine. (Currently, just returns the control to the root of the graph so that the graph can communicate an error message to the client.) in: query graph which was run before signal handling started, NULL not allowed

After signal handling is finished, returns control to a query graph error handling routine. (Currently, just returns the control to the root of the graph so that the graph can communicate an error message to the client.)

Parameters
trxin: trx
forkin: query graph which was run before signal handling started, NULL not allowed

Definition at line 424 of file que0que.cc.

◆ que_fork_get_child()

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

◆ que_fork_get_first_thr()

UNIV_INLINE que_thr_t * que_fork_get_first_thr ( que_fork_t * fork)

Gets the first thr in a fork. in: query fork

◆ que_fork_start_command()

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.

Returns
a query thread of the graph moved to QUE_THR_RUNNING state, or NULL; the query thread should be executed by que_run_threads by the caller in: a query 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.

Returns
a query thread of the graph moved to QUE_THR_RUNNING state, or NULL; the query thread should be executed by que_run_threads by the caller
Parameters
forkin: a query fork

Definition at line 340 of file que0que.cc.

◆ que_graph_free()

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!

Frees a query graph.

Parameters
graphin: 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 677 of file que0que.cc.

◆ que_graph_free_recursive()

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

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.

Parameters
nodein: query graph node

Definition at line 506 of file que0que.cc.

◆ que_graph_is_select()

UNIV_INLINE ibool que_graph_is_select ( que_t * graph)

Returns TRUE if the query graph is for a SELECT statement.

Returns
TRUE if a select in: graph

◆ que_graph_publish()

UNIV_INTERN void que_graph_publish ( que_t * graph,
sess_t * sess )

Adds a query graph to the session's list of graphs. in: session

Adds a query graph to the session's list of graphs.

Parameters
graphin: graph
sessin: session

Definition at line 139 of file que0que.cc.

◆ que_node_get_containing_loop_node()

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.

Returns
containing loop node, or NULL. in: 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.

Returns
containing loop node, or NULL.
Parameters
nodein: node

Definition at line 1065 of file que0que.cc.

◆ que_node_get_data_type()

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

◆ que_node_get_next()

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

◆ que_node_get_parent()

UNIV_INLINE que_node_t * que_node_get_parent ( que_node_t * node)

Gets the parent node of a query graph node.

Returns
parent node or NULL in: node

◆ que_node_get_type()

UNIV_INLINE ulint que_node_get_type ( que_node_t * node)

Gets the type of a graph node. in: graph node

◆ que_node_get_val()

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

◆ que_node_get_val_buf_size()

UNIV_INLINE ulint que_node_get_val_buf_size ( que_node_t * node)

Gets the value buffer size of a graph node.

Returns
val buffer size, not defined if val.data == NULL in node in: graph node

◆ que_node_list_add_last()

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.

Returns
one-way list of nodes in: node
Parameters
node_listin: node list, or NULL

◆ que_node_list_get_len()

UNIV_INLINE ulint que_node_list_get_len ( que_node_t * node_list)

Gets a query graph node list length.

Returns
length, for NULL list 0 in: node list, or NULL

◆ que_node_print_info()

UNIV_INTERN void que_node_print_info ( que_node_t * node)

Prints info of an SQL query graph node. in: query graph node

Prints info of an SQL query graph node.

Parameters
nodein: query graph node

Definition at line 1094 of file que0que.cc.

◆ que_node_set_parent()

UNIV_INLINE void que_node_set_parent ( que_node_t * node,
que_node_t * parent )

Sets the parent of a graph node. in: parent

Parameters
nodein: graph node

◆ que_node_set_val_buf_size()

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

Parameters
nodein: graph node

◆ que_run_threads()

UNIV_INTERN void que_run_threads ( que_thr_t * thr)

Run a query thread. Handles lock waits. in: query thread

Run a query thread. Handles lock waits.

Parameters
thrin: query thread

Definition at line 1328 of file que0que.cc.

◆ que_thr_create()

UNIV_INTERN que_thr_t * que_thr_create ( que_fork_t * parent,
mem_heap_t * heap )

Creates a query graph thread node.

Returns
own: query thread node in: memory heap where created

Creates a query graph thread node.

Returns
own: query thread node
Parameters
parentin: parent node, i.e., a fork node
heapin: memory heap where created

Definition at line 200 of file que0que.cc.

◆ que_thr_end_wait()

UNIV_INTERN void que_thr_end_wait ( que_thr_t * thr,
que_thr_t ** next_thr )

Moves a suspended query thread to the QUE_THR_RUNNING state and releases a single 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. in/out: next query thread to run; if the value which is passed in is a pointer to a NULL pointer, then the calling function can start running a new query thread

Moves a suspended query thread to the QUE_THR_RUNNING state and may release a single 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.

Parameters
thrin: query thread in the QUE_THR_LOCK_WAIT, or QUE_THR_PROCEDURE_WAIT, or QUE_THR_SIG_REPLY_WAIT state
next_thrin/out: next query thread to run; if the value which is passed in is a pointer to a NULL pointer, then the calling function can start running a new query thread; if NULL is passed as the parameter, it is ignored

Definition at line 238 of file que0que.cc.

◆ que_thr_end_wait_no_next_thr()

UNIV_INTERN void que_thr_end_wait_no_next_thr ( que_thr_t * thr)

Same as que_thr_end_wait, but no parameter next_thr available. in: query thread in the QUE_THR_LOCK_WAIT, or QUE_THR_PROCEDURE_WAIT, or QUE_THR_SIG_REPLY_WAIT state

Same as que_thr_end_wait, but no parameter next_thr available.

Parameters
thrin: query thread in the QUE_THR_LOCK_WAIT, or QUE_THR_PROCEDURE_WAIT, or QUE_THR_SIG_REPLY_WAIT state

Definition at line 283 of file que0que.cc.

◆ que_thr_move_to_run_state_for_mysql()

UNIV_INTERN void que_thr_move_to_run_state_for_mysql ( que_thr_t * thr,
trx_t * trx )

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

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.

Parameters
thrin: an query thread
trxin: transaction

Definition at line 999 of file que0que.cc.

◆ que_thr_peek_stop()

UNIV_INLINE ibool que_thr_peek_stop ( que_thr_t * thr)

Checks if graph, trx, or session is in a state where the query thread should be stopped.

Returns
TRUE if should be stopped; NOTE that if the peek is made without reserving the kernel mutex, then another peek with the mutex reserved is necessary before deciding the actual stopping in: query thread

◆ que_thr_stop()

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. The kernel mutex has to be reserved.

Returns
TRUE if stopped 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 kernel mutex has to be reserved.

Returns
TRUE if stopped
Parameters
thrin: query thread

Definition at line 906 of file que0que.cc.

◆ que_thr_stop_for_mysql()

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.c, 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. The query thread is stopped and made inactive, except in the case where it was put to the lock wait state in lock0lock.c, but the lock has already been granted or the transaction chosen as a victim in deadlock resolution.

Parameters
thrin: query thread

Definition at line 953 of file que0que.cc.

◆ que_thr_stop_for_mysql_no_error()

UNIV_INTERN void que_thr_stop_for_mysql_no_error ( que_thr_t * thr,
trx_t * trx )

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

A patch for MySQL used to 'stop' a dummy query thread used in MySQL select, when there is no error or lock wait.

Parameters
thrin: query thread
trxin: transaction

Definition at line 1031 of file que0que.cc.

◆ thr_get_trx()

UNIV_INLINE trx_t * thr_get_trx ( que_thr_t * thr)

Gets the trx of a query thread. in: query thread

◆ thr_is_recv()

UNIV_INLINE ibool thr_is_recv ( const que_thr_t * thr)

Determines if this thread is rolling back an incomplete transaction in crash recovery.

Returns
TRUE if thr is rolling back an incomplete transaction in crash recovery in: query thread