118 const ulint *offsets,
bool clust_templ_for_sec,
140 const byte *key_ptr,
ulint key_len);
230 const char *col_name,
474 const char *index_name,
ulint col_offset,
The index tree persistent cursor.
Read view lists the trx ids of those transactions for which a consistent read should not see the modi...
Definition: read0types.h:48
Represent the record of innodb_table_stats table.
Definition: dict0stats.h:157
static struct my_cs_file_section_st sec[]
Definition: ctype.cc:166
SQL data field and tuple.
dberr_t
Definition: db0err.h:39
Code used for calculating and manipulating table statistics.
Data dictionary global types.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Definition: buf0block_hint.cc:30
const char * db_name
Definition: rules_table_service.cc:55
mode
Definition: file_handle.h:61
page_cur_mode_t
Definition: page0types.h:176
Query graph global types.
void que_node_t
Definition: que0types.h:41
byte rec_t
Definition: rem0types.h:41
Interface between Innobase row operations and MySQL.
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 t...
Definition: row0sel.cc:367
bool row_search_index_stats(const char *db_name, const char *tbl_name, const char *index_name, ulint col_offset, ulonglong *cardinality)
Search the record present in innodb_index_stats using db_name, table name and index_name and fill the...
Definition: row0sel.cc:6380
void row_sel_copy_cached_fields_for_mysql(byte *buf, const byte *cached_rec, row_prebuilt_t *prebuilt)
Copy used fields from cached row.
Definition: row0sel.cc:3519
static que_thr_t * open_step(que_thr_t *thr)
Performs an execution step of an open or close cursor statement node.
static plan_t * sel_node_get_nth_plan(sel_node_t *node, ulint i)
Gets the plan node for the nth table in a join.
row_sel_direction
Search direction for the MySQL interface.
Definition: row0sel.h:408
@ ROW_SEL_PREV
descending direction
Definition: row0sel.h:410
@ ROW_SEL_NEXT
ascending direction
Definition: row0sel.h:409
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 ther...
Definition: row0sel.cc:556
static void row_sel_field_store_in_mysql_format(byte *dest, const mysql_row_templ_t *templ, const dict_index_t *idx, ulint field, const byte *src, ulint len, ulint sec)
Convert a non-SQL-NULL field from Innobase format to MySQL format.
Definition: row0sel.h:448
sel_node_t * sel_node_create(mem_heap_t *heap)
Creates a select node struct.
Definition: row0sel.cc:350
que_thr_t * row_sel_step(que_thr_t *thr)
Performs a select step.
Definition: row0sel.cc:2110
dberr_t row_search_mvcc(byte *buf, page_cur_mode_t mode, row_prebuilt_t *prebuilt, ulint match_mode, const ulint direction)
Searches for rows in the database using cursor.
Definition: row0sel.cc:4413
void row_sel_field_store_in_mysql_format_func(byte *dest, const mysql_row_templ_t *templ, const dict_index_t *index, ulint field_no, const byte *data, ulint len, ulint sec_field)
Stores a non-SQL-NULL field in the MySQL format.
Definition: row0sel.cc:2501
dberr_t row_search_no_mvcc(byte *buf, page_cur_mode_t mode, row_prebuilt_t *prebuilt, ulint match_mode, ulint direction)
Searches for rows in the database using cursor.
Definition: row0sel.cc:3948
sel_node_state
Select node states.
Definition: row0sel.h:320
@ SEL_NODE_NO_MORE_ROWS
cursor has reached the result set end
Definition: row0sel.h:325
@ SEL_NODE_FETCH
intention locks have been set
Definition: row0sel.h:324
@ SEL_NODE_OPEN
intention locks not yet set on tables
Definition: row0sel.h:323
@ SEL_NODE_CLOSED
it is a declared cursor which is not currently open
Definition: row0sel.h:321
que_thr_t * fetch_step(que_thr_t *thr)
Performs a fetch for a cursor.
Definition: row0sel.cc:2209
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)
Converts a key value stored in MySQL format to an Innobase dtuple.
Definition: row0sel.cc:2259
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.
row_sel_match_mode
Match mode for the MySQL interface.
Definition: row0sel.h:414
@ ROW_SEL_EXACT_PREFIX
search using a key prefix which must match rows: the prefix may contain an incomplete field (the last...
Definition: row0sel.h:416
@ ROW_SEL_EXACT
search using a complete key value
Definition: row0sel.h:415
dberr_t row_search_max_autoinc(dict_index_t *index, const char *col_name, uint64_t *value)
Read the max AUTOINC value from an index.
Definition: row0sel.cc:6255
dberr_t row_count_rtree_recs(row_prebuilt_t *prebuilt, ulint *n_rows, ulint *n_dups)
Count rows in a R-Tree leaf level.
Definition: row0sel.cc:6059
open_node_op
Open or close cursor operation type.
Definition: row0sel.h:394
@ ROW_SEL_CLOSE_CURSOR
close cursor
Definition: row0sel.h:396
@ ROW_SEL_OPEN_CURSOR
open cursor
Definition: row0sel.h:395
bool row_search_table_stats(const char *db_name, const char *tbl_name, TableStatsRecord &table_stats)
Search the record present in innodb_table_stats table using db_name, table_name and fill it in table ...
Definition: row0sel.cc:6318
bool row_sel_store_mysql_rec(byte *mysql_rec, row_prebuilt_t *prebuilt, const rec_t *rec, const dtuple_t *vrow, bool rec_clust, const dict_index_t *rec_index, const dict_index_t *prebuilt_index, const ulint *offsets, bool clust_templ_for_sec, lob::undo_vers_t *lob_undo, mem_heap_t *&blob_heap)
Convert a row in the Innobase format to a row in the MySQL format.
Definition: row0sel.cc:2889
Row operation global types.
Definition: btr0pcur.h:99
Data structure for an index.
Definition: dict0mem.h:1046
Data structure for a database table.
Definition: dict0mem.h:1909
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:684
Fetch statement node.
Definition: row0sel.h:376
sel_node_t * cursor_def
cursor definition
Definition: row0sel.h:378
pars_user_func_t * func
User callback function or NULL.
Definition: row0sel.h:381
sym_node_t * into_list
variables to set
Definition: row0sel.h:379
que_common_t common
type: QUE_NODE_FETCH
Definition: row0sel.h:377
A predefined function or operator node in a parsing tree; this construct is also used for some non-fu...
Definition: pars0pars.h:497
The list of modifications to be applied on LOBs to get older versions.
Definition: lob0undo.h:146
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
Definition: row0mysql.h:455
Open or close cursor statement node.
Definition: row0sel.h:400
enum open_node_op op_type
operation type: open or close cursor
Definition: row0sel.h:402
sel_node_t * cursor_def
cursor definition
Definition: row0sel.h:404
que_common_t common
type: QUE_NODE_OPEN
Definition: row0sel.h:401
An order-by node in a select.
Definition: pars0pars.h:516
User-supplied function and argument.
Definition: pars0pars.h:467
Query plan.
Definition: row0sel.h:247
ulint first_prefetched
index of the first cached row in select buffer arrays for each column
Definition: row0sel.h:285
page_cur_mode_t mode
search mode: PAGE_CUR_G, ...
Definition: row0sel.h:274
Cond_list other_conds
the rest of search conditions we can test at this table in a join
Definition: row0sel.h:297
ulint n_rows_prefetched
number of prefetched rows cached for fetch: fetching several rows in the same mtr saves CPU time
Definition: row0sel.h:282
dtuple_t * clust_ref
the reference to the clustered index entry is built here if index is a non-clustered index
Definition: row0sel.h:309
sym_node_list_t columns
symbol table nodes for the columns to retrieve from the table
Definition: row0sel.h:288
bool no_prefetch
no prefetch for this table
Definition: row0sel.h:287
bool unique_search
true if we are searching an index record with a unique key
Definition: row0sel.h:278
dict_table_t * table
table struct in the dictionary cache
Definition: row0sel.h:248
mem_heap_t * old_vers_heap
memory heap used in building an old version of a row, or NULL
Definition: row0sel.h:315
bool must_get_clust
true if index is a non-clustered index and we must also fetch the clustered index record; this is the...
Definition: row0sel.h:298
bool asc
true if cursor traveling upwards
Definition: row0sel.h:253
dtuple_t * tuple
search tuple
Definition: row0sel.h:273
bool pcur_is_open
true if pcur has been positioned and we can try to fetch new rows
Definition: row0sel.h:254
que_node_t ** tuple_exps
array of expressions which are used to calculate the field values in the search tuple: there is one e...
Definition: row0sel.h:267
bool cursor_at_end
true if the cursor is open but we know that there are no more qualifying rows left to retrieve from t...
Definition: row0sel.h:256
btr_pcur_t clust_pcur
if index is non-clustered, we use this pcur to search the clustered index
Definition: row0sel.h:312
dict_index_t * index
table index used in the search
Definition: row0sel.h:250
UT_LIST_BASE_NODE_T_EXTERN(func_node_t, cond_list) Cond_list
Definition: row0sel.h:290
bool stored_cursor_rec_processed
true if the pcur position has been stored and the record it is positioned on has already been process...
Definition: row0sel.h:263
ulint n_exact_match
number of first fields in the search tuple which must be exactly matched
Definition: row0sel.h:275
Cond_list end_conds
conditions which determine the fetch limit of the index segment we have to look at: when one of these...
Definition: row0sel.h:295
ulint n_rows_fetched
number of rows fetched using pcur after it was opened
Definition: row0sel.h:280
btr_pcur_t pcur
persistent cursor used to search the index
Definition: row0sel.h:251
ulint * clust_map
map telling how clust_ref is built from the fields of a non-clustered record
Definition: row0sel.h:306
Definition: que0types.h:51
Definition: que0que.h:242
A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; th...
Definition: row0mysql.h:515
A structure for caching column values for prefetched rows.
Definition: row0sel.h:234
byte * data
data, or NULL; if not NULL, this field has allocated memory which must be explicitly freed; can be !...
Definition: row0sel.h:235
ulint len
data length or UNIV_SQL_NULL
Definition: row0sel.h:239
ulint val_buf_size
size of memory buffer allocated for data: this can be more than len; this is defined when data !...
Definition: row0sel.h:240
Select statement node.
Definition: row0sel.h:329
plan_t * plans
array of n_tables many plan nodes containing the search plan and the search data structures
Definition: row0sel.h:344
sym_node_list_t copy_variables
variables whose values we have to copy when an explicit cursor is opened, so that they do not change ...
Definition: row0sel.h:372
sym_node_t * into_list
variables list or NULL
Definition: row0sel.h:333
ulint row_lock_mode
LOCK_X or LOCK_S.
Definition: row0sel.h:340
que_common_t common
node type: QUE_NODE_SELECT
Definition: row0sel.h:330
bool consistent_read
true if the select is a consistent, non-locking read
Definition: row0sel.h:351
bool asc
true if the rows should be fetched in an ascending order
Definition: row0sel.h:335
sym_node_t * explicit_cursor
not NULL if an explicit cursor
Definition: row0sel.h:369
order_node_t * order_by
order by column definition, or NULL
Definition: row0sel.h:353
que_node_t * select_list
select list
Definition: row0sel.h:332
bool can_get_updated
this is true if the select is in a single-table explicit cursor which can get updated within the stor...
Definition: row0sel.h:367
que_node_t * search_cond
search condition
Definition: row0sel.h:347
ReadView * read_view
if the query is a non-locking consistent read, its read view is placed here, otherwise NULL
Definition: row0sel.h:348
ulint n_tables
number of tables
Definition: row0sel.h:341
bool aggregate_already_fetched
true if the aggregate row has already been fetched for the current cursor
Definition: row0sel.h:357
bool set_x_locks
true if the cursor is for update or delete, which means that a row x-lock should be placed on the cur...
Definition: row0sel.h:337
ulint fetch_table
number of the next table to access in the join
Definition: row0sel.h:342
sym_node_t * table_list
table list
Definition: row0sel.h:334
bool is_aggregate
true if the select list consists of aggregate functions
Definition: row0sel.h:355
enum sel_node_state state
node state
Definition: row0sel.h:331
Symbol table node.
Definition: pars0sym.h:113
Transaction system global type definitions.
Version control for database, common definitions, and include files.
#define IF_DEBUG(...)
Definition: univ.i:674
unsigned long int ulint
Definition: univ.i:406
#define UT_LIST_BASE_NODE_T_EXTERN(t, m)
A variant of UT_LIST_BASE_NODE_T to be used in rare cases where the full definition of t is not yet i...
Definition: ut0lst.h:279