MySQL 8.0.37
Source Code Documentation
row0sel.ic File Reference

Select. More...

#include "que0que.h"

Functions

static plan_tsel_node_get_nth_plan (sel_node_t *node, ulint i)
 Gets the plan node for the nth table in a join. More...
 
static void sel_node_reset_cursor (sel_node_t *node)
 Resets the cursor defined by sel_node to the SEL_NODE_OPEN state, which means that it will start fetching from the start of the result set again, regardless of where it was before, and it will set intention locks on the tables. More...
 
static que_thr_topen_step (que_thr_t *thr)
 Performs an execution step of an open or close cursor statement node. More...
 
static dberr_t row_search_for_mysql (byte *buf, page_cur_mode_t mode, row_prebuilt_t *prebuilt, ulint match_mode, ulint direction)
 Searches for rows in the database. More...
 

Detailed Description

Select.

Created 12/19/1997 Heikki Tuuri

Function Documentation

◆ open_step()

static que_thr_t * open_step ( que_thr_t thr)
inlinestatic

Performs an execution step of an open or close cursor statement node.

Returns
query thread to run next or NULL
Parameters
thrin: query thread

◆ row_search_for_mysql()

static dberr_t row_search_for_mysql ( byte buf,
page_cur_mode_t  mode,
row_prebuilt_t prebuilt,
ulint  match_mode,
ulint  direction 
)
inlinestatic

Searches for rows in the database.

This is used in the interface to MySQL. This function opens a cursor, and also implements fetch next and fetch prev. NOTE that if we do a search with a full key value from a unique index (ROW_SEL_EXACT), then we will not store the cursor position and fetch next or fetch prev must not be tried to the cursor!

Parameters
[out]bufbuffer for the fetched row in MySQL format
[in]modesearch mode PAGE_CUR_L
[in,out]prebuiltprebuilt struct for the table handler; this contains the info to search_tuple, index; if search tuple contains 0 field then we position the cursor at start or the end of index, depending on 'mode'
[in]match_mode0 or ROW_SEL_EXACT or ROW_SEL_EXACT_PREFIX
[in]direction0 or ROW_SEL_NEXT or ROW_SEL_PREV; Note: if this is != 0, then prebuilt must has a pcur with stored position! In opening of a cursor 'direction' should be 0.
Returns
DB_SUCCESS, DB_RECORD_NOT_FOUND, DB_END_OF_INDEX, DB_DEADLOCK, DB_LOCK_TABLE_FULL, DB_CORRUPTION, or DB_TOO_BIG_RECORD

◆ sel_node_get_nth_plan()

static plan_t * sel_node_get_nth_plan ( sel_node_t node,
ulint  i 
)
inlinestatic

Gets the plan node for the nth table in a join.

Returns
plan node
Parameters
nodein: select node
iin: get ith plan node

◆ sel_node_reset_cursor()

static void sel_node_reset_cursor ( sel_node_t node)
inlinestatic

Resets the cursor defined by sel_node to the SEL_NODE_OPEN state, which means that it will start fetching from the start of the result set again, regardless of where it was before, and it will set intention locks on the tables.

Parameters
nodein: select node