| MySQL 5.6.14 Source Code Document
    | 
#include "univ.i"#include "data0data.h"#include "que0types.h"#include "dict0types.h"#include "trx0types.h"#include "row0types.h"#include "pars0sym.h"#include "btr0pcur.h"#include "read0read.h"#include "row0mysql.h"#include "row0sel.ic"

Go to the source code of this file.
| Classes | |
| struct | sel_buf_t | 
| struct | plan_t | 
| struct | sel_node_t | 
| struct | fetch_node_t | 
| struct | open_node_t | 
| struct | row_printf_node_t | 
| Enumerations | |
| enum | sel_node_state { SEL_NODE_CLOSED, SEL_NODE_OPEN, SEL_NODE_FETCH, SEL_NODE_NO_MORE_ROWS } | 
| enum | open_node_op { ROW_SEL_OPEN_CURSOR, ROW_SEL_CLOSE_CURSOR } | 
| enum | row_sel_direction { ROW_SEL_NEXT = 1, ROW_SEL_PREV = 2 } | 
| enum | row_sel_match_mode { ROW_SEL_EXACT = 1, ROW_SEL_EXACT_PREFIX } | 
| Functions | |
| UNIV_INTERN sel_node_t * | sel_node_create (mem_heap_t *heap) | 
| UNIV_INTERN void | sel_node_free_private (sel_node_t *node) | 
| UNIV_INTERN void | sel_col_prefetch_buf_free (sel_buf_t *prefetch_buf) | 
| UNIV_INLINE plan_t * | sel_node_get_nth_plan (sel_node_t *node, ulint i) | 
| UNIV_INTERN que_thr_t * | row_sel_step (que_thr_t *thr) | 
| UNIV_INLINE que_thr_t * | open_step (que_thr_t *thr) | 
| UNIV_INTERN que_thr_t * | fetch_step (que_thr_t *thr) | 
| UNIV_INTERN void * | row_fetch_print (void *row, void *user_arg) | 
| UNIV_INTERN que_thr_t * | row_printf_step (que_thr_t *thr) | 
| UNIV_INTERN void | row_sel_convert_mysql_key_to_innobase (dtuple_t *tuple, byte *buf, ulint buf_len, dict_index_t *index, const byte *key_ptr, ulint key_len, trx_t *trx) | 
| UNIV_INTERN dberr_t | row_search_for_mysql (byte *buf, ulint mode, row_prebuilt_t *prebuilt, ulint match_mode, ulint direction) __attribute__((nonnull | 
| UNIV_INTERN ibool | row_search_check_if_query_cache_permitted (trx_t *trx, const char *norm_name) | 
| UNIV_INTERN dberr_t | row_search_max_autoinc (dict_index_t *index, const char *col_name, ib_uint64_t *value) __attribute__((nonnull | 
| Variables | |
| UNIV_INTERN dberr_t | warn_unused_result | 
| enum open_node_op | 
| enum row_sel_direction | 
| enum row_sel_match_mode | 
Match mode for the MySQL interface
| enum sel_node_state | 
Performs a fetch for a cursor.

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

| UNIV_INTERN void* row_fetch_print | ( | void * | row, | 
| void * | user_arg | ||
| ) | 
Sample callback function for fetch that prints each row.
| row | in: sel_node_t* | 
Prints a row in a select result.

| UNIV_INTERN ibool row_search_check_if_query_cache_permitted | ( | trx_t * | trx, | 
| const char * | norm_name | ||
| ) | 
Checks if MySQL at the moment is allowed for this table to retrieve a consistent read result, or store it to the query cache.
| trx | in: transaction object | 
| UNIV_INTERN dberr_t row_search_for_mysql | ( | byte * | buf, | 
| ulint | mode, | ||
| row_prebuilt_t * | prebuilt, | ||
| ulint | match_mode, | ||
| ulint | direction | ||
| ) | 
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!
| buf | in/out: buffer for the fetched row in the MySQL format | 
| mode | in: search mode PAGE_CUR_L, ... | 
| prebuilt | in: prebuilt struct for the table handle; this contains the info of search_tuple, index; if search tuple contains 0 fields then we position the cursor at the start or the end of the index, depending on 'mode' | 
| match_mode | in: 0 or ROW_SEL_EXACT or ROW_SEL_EXACT_PREFIX | 
| direction | in: 0 or ROW_SEL_NEXT or ROW_SEL_PREV; NOTE: if this is != 0, then prebuilt must have a pcur with stored position! In opening of a cursor 'direction' should be 0. | 

| UNIV_INTERN dberr_t row_search_max_autoinc | ( | dict_index_t * | index, | 
| const char * | col_name, | ||
| ib_uint64_t * | value | ||
| ) | 
Read the max AUTOINC value from an index.
| index | in: index to search | 
| col_name | in: autoinc column name | 
| value | out: AUTOINC value read | 
| UNIV_INTERN void row_sel_convert_mysql_key_to_innobase | ( | dtuple_t * | tuple, | 
| byte * | buf, | ||
| ulint | buf_len, | ||
| dict_index_t * | index, | ||
| const byte * | key_ptr, | ||
| ulint | key_len, | ||
| trx_t * | trx | ||
| ) | 
Converts a key value stored in MySQL format to an Innobase dtuple. The last field of the key value may be just a prefix of a fixed length field: hence the parameter key_len. But currently we do not allow search keys where the last field is only a prefix of the full key field len and print a warning if such appears. in: transaction
| tuple | in/out: tuple where to build; NOTE: we assume that the type info in the tuple is already according to index! | 
| buf | in: buffer to use in field conversions; NOTE that dtuple->data may end up pointing inside buf so do not discard that buffer while the tuple is being used. See row_mysql_store_col_in_innobase_format() in the case of DATA_INT | 
| buf_len | in: buffer length | 
| index | in: index of the key value | 
| key_ptr | in: MySQL key value | 
| key_len | in: MySQL key value length | 

Performs a select step. This is a high-level function used in SQL execution graphs.

| UNIV_INTERN void sel_col_prefetch_buf_free | ( | sel_buf_t * | prefetch_buf | ) | 
Frees a prefetch buffer for a column, including the dynamically allocated memory for data stored there. in, own: prefetch buffer
Frees a prefetch buffer for a column, including the dynamically allocated memory for data stored there.
| prefetch_buf | in, own: prefetch buffer | 
Definition at line 524 of file row0sel.cc.

| UNIV_INTERN sel_node_t* sel_node_create | ( | mem_heap_t * | heap | ) | 
Creates a select node struct.
Creates a select node struct.
| heap | in: memory heap where created | 
Definition at line 270 of file row0sel.cc.


| UNIV_INTERN void sel_node_free_private | ( | sel_node_t * | node | ) | 
Frees the memory private to a select node when a query graph is freed, does not free the heap where the node was originally created. in: select node struct
Frees the memory private to a select node when a query graph is freed, does not free the heap where the node was originally created.
| node | in: select node struct | 
Definition at line 292 of file row0sel.cc.


| UNIV_INLINE plan_t* sel_node_get_nth_plan | ( | sel_node_t * | node, | 
| ulint | i | ||
| ) | 
Gets the plan node for the nth table in a join.
| node | in: select node | 
