MySQL 9.6.0
Source Code Documentation
api0api.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2008, 2025, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/** @file include/api0api.h
29 InnoDB Native API
30
31 2008-08-01 Created by Sunny Bains.
32 3/20/2011 Jimmy Yang extracted from Embedded InnoDB
33 *******************************************************/
34
35#ifndef api0api_h
36#define api0api_h
37
38#include <stdint.h>
39#include <stdio.h>
40
41#include "my_config.h"
42
43#include "data0data.h"
44#include "db0err.h"
45
46/** Page number */
47typedef uint32_t page_no_t;
48/** Tablespace identifier */
49typedef uint32_t space_id_t;
50
51typedef struct ib_sdi_key ib_sdi_key_t;
53
54/* Basic types used by the InnoDB API. */
55/** All InnoDB error codes are represented by ib_err_t */
56typedef enum dberr_t ib_err_t;
57/** Representation of a byte within InnoDB */
58typedef unsigned char ib_byte_t;
59
60/** Representation of an unsigned long int within InnoDB */
61#ifdef _WIN64
62typedef unsigned __int64 ib_ulint_t;
63#else
64typedef unsigned long int ib_ulint_t;
65#endif /* _WIN64 */
66
67typedef void *ib_opaque_t;
69typedef uint64_t ib_id_u64_t;
70
71/** @enum ib_cfg_type_t Possible types for a configuration variable. */
72typedef enum {
73 IB_CFG_BOOL, /*!< The configuration parameter is
74 of type bool */
75
76 /* XXX Can we avoid having different types for ulint and ulong?
77 - On Win64 "unsigned long" is 32 bits
78 - ulong is always defined as "unsigned long"
79 - On Win64 ulint is defined as 64 bit integer
80 => On Win64 ulint != ulong.
81 If we typecast all ulong and ulint variables to the smaller type
82 ulong, then we will cut the range of the ulint variables.
83 This is not a problem for most ulint variables because their max
84 allowed values do not exceed 2^32-1 (e.g. log_groups is ulint
85 but its max allowed value is 10). BUT buffer_pool_size and
86 log_file_size allow up to 2^64-1. */
87
88 IB_CFG_ULINT, /*!< The configuration parameter is
89 of type ulint */
90
91 IB_CFG_ULONG, /*!< The configuration parameter is
92 of type ulong */
93
94 IB_CFG_TEXT, /*!< The configuration parameter is
95 of type char* */
96
97 IB_CFG_CB /*!< The configuration parameter is
98 a callback parameter */
100
101/** @enum ib_col_type_t column types that are supported. */
102typedef enum {
103 IB_VARCHAR = 1, /*!< Character varying length. The
104 column is not padded. */
105
106 IB_CHAR = 2, /*!< Fixed length character string. The
107 column is padded to the right. */
108
109 IB_BINARY = 3, /*!< Fixed length binary, similar to
110 IB_CHAR but the column is not padded
111 to the right. */
112
113 IB_VARBINARY = 4, /*!< Variable length binary */
114
115 IB_BLOB = 5, /*!< Binary large object, or
116 a TEXT type */
117
118 IB_INT = 6, /*!< Integer: can be any size
119 from 1 - 8 bytes. If the size is
120 1, 2, 4 and 8 bytes then you can use
121 the typed read and write functions. For
122 other sizes you will need to use the
123 ib_col_get_value() function and do the
124 conversion yourself. */
125
126 IB_SYS = 8, /*!< System column, this column can
127 be one of DATA_TRX_ID, DATA_ROLL_PTR
128 or DATA_ROW_ID. */
129
130 IB_FLOAT = 9, /*!< C (float) floating point value. */
131
132 IB_DOUBLE = 10, /*!> C (double) floating point value. */
133
134 IB_DECIMAL = 11, /*!< Decimal stored as an ASCII
135 string */
136
137 IB_VARCHAR_ANYCHARSET = 12, /*!< Any charset, varying length */
138
139 IB_CHAR_ANYCHARSET = 13 /*!< Any charset, fixed length */
140
142
143/** @enum ib_tbl_fmt_t InnoDB table format types */
144typedef enum {
145 IB_TBL_REDUNDANT, /*!< Redundant row format, the column
146 type and length is stored in the row.*/
147
148 IB_TBL_COMPACT, /*!< Compact row format, the column
149 type is not stored in the row. The
150 length is stored in the row but the
151 storage format uses a compact format
152 to store the length of the column data
153 and record data storage format also
154 uses less storage. */
155
156 IB_TBL_DYNAMIC, /*!< Compact row format. BLOB prefixes
157 are not stored in the clustered index */
158
159 IB_TBL_COMPRESSED /*!< Similar to dynamic format but
160 with pages compressed */
162
163/** @enum ib_col_attr_t InnoDB column attributes */
164typedef enum {
165 IB_COL_NONE = 0, /*!< No special attributes. */
166
167 IB_COL_NOT_NULL = 1, /*!< Column data can't be NULL. */
168
169 IB_COL_UNSIGNED = 2, /*!< Column is IB_INT and unsigned. */
170
171 IB_COL_NOT_USED = 4, /*!< Future use, reserved. */
172
173 IB_COL_CUSTOM1 = 8, /*!< Custom precision type, this is
174 a bit that is ignored by InnoDB and so
175 can be set and queried by users. */
176
177 IB_COL_CUSTOM2 = 16, /*!< Custom precision type, this is
178 a bit that is ignored by InnoDB and so
179 can be set and queried by users. */
180
181 IB_COL_CUSTOM3 = 32 /*!< Custom precision type, this is
182 a bit that is ignored by InnoDB and so
183 can be set and queried by users. */
185
186/* Note: must match lock0types.h */
187/** @enum ib_lck_mode_t InnoDB lock modes. */
188typedef enum {
189 IB_LOCK_IS = 0, /*!< Intention shared, an intention
190 lock should be used to lock tables */
191
192 IB_LOCK_IX, /*!< Intention exclusive, an intention
193 lock should be used to lock tables */
194
195 IB_LOCK_S, /*!< Shared locks should be used to
196 lock rows */
197
198 IB_LOCK_X, /*!< Exclusive locks should be used to
199 lock rows*/
200
201 IB_LOCK_TABLE_X, /*!< exclusive table lock */
202
203 IB_LOCK_NONE, /*!< This is used internally to note
204 consistent read */
205
206 IB_LOCK_NUM = IB_LOCK_NONE /*!< number of lock modes */
208
209typedef enum {
210 IB_CLUSTERED = 1, /*!< clustered index */
211 IB_UNIQUE = 2 /*!< unique index */
213
214/** @enum ib_srch_mode_t InnoDB cursor search modes for ib_cursor_moveto().
215Note: Values must match those found in page0cur.h */
216typedef enum {
217 IB_CUR_G = 1, /*!< If search key is not found then
218 position the cursor on the row that
219 is greater than the search key */
220
221 IB_CUR_GE = 2, /*!< If the search key not found then
222 position the cursor on the row that
223 is greater than or equal to the search
224 key */
225
226 IB_CUR_L = 3, /*!< If search key is not found then
227 position the cursor on the row that
228 is less than the search key */
229
230 IB_CUR_LE = 4 /*!< If search key is not found then
231 position the cursor on the row that
232 is less than or equal to the search
233 key */
235
236/** @enum ib_match_mode_t Various match modes used by ib_cursor_moveto() */
237typedef enum {
238 IB_CLOSEST_MATCH, /*!< Closest match possible */
239
240 IB_EXACT_MATCH, /*!< Search using a complete key
241 value */
242
243 IB_EXACT_PREFIX /*!< Search using a key prefix which
244 must match to rows: the prefix may
245 contain an incomplete field (the
246 last field in prefix may be just
247 a prefix of a fixed length column) */
249
250/** InnoDB column meta data. */
251typedef struct {
252 ib_col_type_t type; /*!< Type of the column */
253
254 ib_col_attr_t attr; /*!< Column attributes */
255
256 uint32_t type_len; /*!< Length of type */
257
258 uint16_t client_type; /*!< 16 bits of data relevant only to
259 the client. InnoDB doesn't care */
260
261 ib_charset_t *charset; /*!< Column charset */
263
264/* Note: Must be in sync with trx0trx.h */
265/** @enum ib_trx_level_t Transaction isolation levels */
266typedef enum {
267 IB_TRX_READ_UNCOMMITTED = 0, /*!< Dirty read: non-locking SELECTs are
268 performed so that we do not look at a
269 possible earlier version of a record;
270 thus they are not 'consistent' reads
271 under this isolation level; otherwise
272 like level 2 */
273
274 IB_TRX_READ_COMMITTED = 1, /*!< Somewhat Oracle-like isolation,
275 except that in range UPDATE and DELETE
276 we must block phantom rows with
277 next-key locks; SELECT ... FOR UPDATE
278 and ... LOCK IN SHARE MODE only lock
279 the index records, NOT the gaps before
280 them, and thus allow free inserting;
281 each consistent read reads its own
282 snapshot */
283
284 IB_TRX_REPEATABLE_READ = 2, /*!< All consistent reads in the same
285 trx read the same snapshot; full
286 next-key locking used in locking reads
287 to block insertions into gaps */
288
289 IB_TRX_SERIALIZABLE = 3 /*!< All plain SELECTs are converted to
290 LOCK IN SHARE MODE reads */
292
293/** Generical InnoDB callback prototype. */
294typedef void (*ib_cb_t)(void);
295
296constexpr uint32_t IB_CFG_BINLOG_ENABLED = 0x1;
297constexpr uint32_t IB_CFG_MDL_ENABLED = 0x2;
298constexpr uint32_t IB_CFG_DISABLE_ROWLOCK = 0x4;
299
300/** Used by ib_read_tuple to determine number of bytes to allocate for new slot
301if needed */
302static const size_t REC_BUF_SLOT_SIZE = 16384;
303
304/** The first argument to the InnoDB message logging function. By default
305it's set to stderr. You should treat ib_msg_stream_t as a void*, since
306it will probably change in the future. */
308
309/** All log messages are written to this function.It should have the same
310behavior as fprintf(3). */
311typedef int (*ib_msg_log_t)(ib_msg_stream_t, const char *, ...);
312
313/* Note: This is to make it easy for API users to have type
314checking for arguments to our functions. Making it ib_opaque_t
315by itself will result in pointer decay resulting in subverting
316of the compiler's type checking. */
317
318/** InnoDB tuple handle. This handle can refer to either a cluster index
319tuple or a secondary index tuple. There are two types of tuples for each
320type of index, making a total of four types of tuple handles. There
321is a tuple for reading the entire row contents and another for searching
322on the index key. */
323typedef struct ib_tuple_t *ib_tpl_t;
324
326
327/** InnoDB transaction handle, all database operations need to be covered
328by transactions. This handle represents a transaction. The handle can be
329created with ib_trx_begin(), you commit your changes with ib_trx_commit()
330and undo your changes using ib_trx_rollback(). If the InnoDB deadlock
331monitor rolls back the transaction then you need to free the transaction
332using the function ib_trx_release(). You can query the state of an InnoDB
333transaction by calling ib_trx_state(). */
334typedef struct trx_t *ib_trx_t;
335
336/** InnoDB cursor handle */
337typedef struct ib_cursor_t *ib_crsr_t;
338
339struct row_prebuilt_t;
341
342/** This function is used to compare two data fields for which the data type
343 is such that we must use the client code to compare them.
344
345 @param col_meta column meta data
346 @param p1 key
347 @param p1_len key length
348 @param p2 second key
349 @param p2_len second key length
350 @return 1, 0, -1, if a is greater, equal, less than b, respectively */
351
352typedef int (*ib_client_cmp_t)(const ib_col_meta_t *col_meta,
353 const ib_byte_t *p1, uint64_t p1_len,
354 const ib_byte_t *p2, uint64_t p2_len);
355
356/* This should be the same as univ.i */
357/** Represents SQL_NULL length */
358constexpr uint32_t IB_SQL_NULL = 0xFFFFFFFF;
359
360/** Start a transaction that's been rolled back. This special function
361 exists for the case when InnoDB's deadlock detector has rolledack
362 a transaction. While the transaction has been rolled back the handle
363 is still valid and can be reused by calling this function. If you
364 don't want to reuse the transaction handle then you can free the handle
365 by calling ib_trx_release().
366 @return innobase txn handle */
368 ib_trx_t ib_trx, /*!< in: transaction to restart */
369 ib_trx_level_t ib_trx_level, /*!< in: trx isolation level */
370 bool read_write, /*!< in: true if read write
371 transaction */
372 bool auto_commit, /*!< in: auto commit after each
373 single DML */
374 void *thd); /*!< in: THD */
375
376/** Begin a transaction. This will allocate a new transaction handle and
377put the transaction in the active state.
378@param[in] ib_trx_level trx isolation level
379@param[in] read_write true if read write transaction
380@param[in] auto_commit auto commit after each single DML
381@param[in,out] thd MySQL THD
382@return innobase txn handle */
383ib_trx_t ib_trx_begin(ib_trx_level_t ib_trx_level, bool read_write,
384 bool auto_commit, void *thd);
385
386/** Check if the transaction is read_only */
387uint32_t ib_trx_read_only(ib_trx_t ib_trx); /*!< in: trx handle */
388
389/** Release the resources of the transaction. If the transaction was
390 selected as a victim by InnoDB and rolled back then use this function
391 to free the transaction handle.
392 @return DB_SUCCESS or err code */
393ib_err_t ib_trx_release(ib_trx_t ib_trx); /*!< in: trx handle */
394
395/** Commit a transaction. This function will release the schema latches too.
396 It will also free the transaction handle.
397 @return DB_SUCCESS or err code */
398ib_err_t ib_trx_commit(ib_trx_t ib_trx); /*!< in: trx handle */
399
400/** Rollback a transaction. This function will release the schema latches too.
401 It will also free the transaction handle.
402 @return DB_SUCCESS or err code */
403ib_err_t ib_trx_rollback(ib_trx_t ib_trx); /*!< in: trx handle */
404
405/** Open an InnoDB secondary index cursor and return a cursor handle to it.
406 @return DB_SUCCESS or err code */
408 ib_crsr_t ib_open_crsr, /*!< in: open/active cursor */
409 const char *index_name, /*!< in: secondary index name */
410 ib_crsr_t *ib_crsr, /*!< out,own: InnoDB index cursor */
411 int *idx_type, /*!< out: index is cluster index */
412 ib_id_u64_t *idx_id); /*!< out: index id */
413
414/** Open an InnoDB table by name and return a cursor handle to it.
415 @return DB_SUCCESS or err code */
417 const char *name, /*!< in: table name */
418 ib_trx_t ib_trx, /*!< in: Current transaction handle
419 can be NULL */
420 ib_crsr_t *ib_crsr); /*!< out,own: InnoDB cursor */
421
422/** Reset the cursor.
423 @return DB_SUCCESS or err code */
424ib_err_t ib_cursor_reset(ib_crsr_t ib_crsr); /*!< in/out: InnoDB cursor */
425
426/** Close an InnoDB table and free the cursor.
427 @return DB_SUCCESS or err code */
428ib_err_t ib_cursor_close(ib_crsr_t ib_crsr); /*!< in/out: InnoDB cursor */
429
430/** update the cursor with new transactions and also reset the cursor
431 @return DB_SUCCESS or err code */
432ib_err_t ib_cursor_new_trx(ib_crsr_t ib_crsr, /*!< in/out: InnoDB cursor */
433 ib_trx_t ib_trx); /*!< in: transaction */
434
435/** Commit the transaction in a cursor
436 @return DB_SUCCESS or err code */
437ib_err_t ib_cursor_commit_trx(ib_crsr_t ib_crsr, /*!< in/out: InnoDB cursor */
438 ib_trx_t ib_trx); /*!< in: transaction */
439
440/** Insert a row to a table.
441 @return DB_SUCCESS or err code */
443 ib_crsr_t ib_crsr, /*!< in/out: InnoDB cursor instance */
444 const ib_tpl_t ib_tpl); /*!< in: tuple to insert */
445
446/** Update a row in a table.
447 @return DB_SUCCESS or err code */
449 ib_crsr_t ib_crsr, /*!< in: InnoDB cursor instance */
450 const ib_tpl_t ib_old_tpl, /*!< in: Old tuple in table */
451 const ib_tpl_t ib_new_tpl); /*!< in: New tuple to update */
452
453/** Delete a row in a table.
454 @return DB_SUCCESS or err code */
455ib_err_t ib_cursor_delete_row(ib_crsr_t ib_crsr); /*!< in: cursor instance */
456
457/** Read current row.
458 @return DB_SUCCESS or err code */
460 ib_crsr_t ib_crsr, /*!< in: InnoDB cursor instance */
461 ib_tpl_t ib_tpl, /*!< out: read cols into this tuple */
462 ib_tpl_t cmp_tpl, /*!< in: tuple to compare and stop
463 reading */
464 int mode, /*!< in: mode determine when to
465 stop read */
466 void **row_buf, /*!< in/out: row buffer */
467 uint64_t *row_len, /*!< in/out: row buffer len */
468 uint64_t *used_len); /*!< in/out: row buffer len used */
469
470/** Move cursor to the first record in the table.
471 @return DB_SUCCESS or err code */
472ib_err_t ib_cursor_first(ib_crsr_t ib_crsr); /*!< in: InnoDB cursor instance */
473
474/** Move cursor to the next record in the table.
475 @return DB_SUCCESS or err code */
476ib_err_t ib_cursor_next(ib_crsr_t ib_crsr); /*!< in: InnoDB cursor instance */
477
478/** Search for key.
479 @return DB_SUCCESS or err code */
480ib_err_t ib_cursor_moveto(ib_crsr_t ib_crsr, /*!< in: InnoDB cursor instance */
481 ib_tpl_t ib_tpl, /*!< in: Key to search for */
482 ib_srch_mode_t ib_srch_mode, /*!< in: search mode */
483 uint64_t direction); /*!< in: search direction */
484
485/** Set the match mode for ib_cursor_move().
486@param[in] ib_crsr Cursor instance
487@param[in] match_mode ib_cursor_moveto match mode*/
488void ib_cursor_set_match_mode(ib_crsr_t ib_crsr, ib_match_mode_t match_mode);
489
490/** Set a column of the tuple. Make a copy using the tuple's heap.
491 @param[in] ib_tpl tuple instance
492 @param[in] col_no column index in tuple
493 @param[in] src data value
494 @param[in] len data value len
495 @param[in] need_cpy if need memcpy
496 @return DB_SUCCESS or error code */
497ib_err_t ib_col_set_value(ib_tpl_t ib_tpl, ib_ulint_t col_no, const void *src,
498 uint64_t len, bool need_cpy);
499
500/** Copy a column value from the tuple.
501 @param[in] ib_tpl tuple instance
502 @param[in] i in column index in tuple
503 @param[out] dst copied data value
504 @param[in] len max data value len to copy
505 @return bytes copied or IB_SQL_NULL */
506uint64_t ib_col_copy_value(ib_tpl_t ib_tpl, ib_ulint_t i, void *dst,
507 uint32_t len);
508
509/** Read a signed int 8 bit column from an InnoDB tuple.
510 @param[in] ib_tpl InnoDB tuple
511 @param[in] i column number
512 @param[out] ival integer value
513 @return DB_SUCCESS or error */
514ib_err_t ib_tuple_read_i8(ib_tpl_t ib_tpl, ib_ulint_t i, int8_t *ival);
515
516/** Read an unsigned int 8 bit column from an InnoDB tuple.
517 @param[in] ib_tpl InnoDB tuplr
518 @param[in] i column number
519 @param[out] ival integer value
520 @return DB_SUCCESS or error */
521ib_err_t ib_tuple_read_u8(ib_tpl_t ib_tpl, ib_ulint_t i, uint8_t *ival);
522
523/** Read a signed int 16 bit column from an InnoDB tuple.
524 @param[in] ib_tpl InnoDB tuple
525 @param[in] i column number
526 @param[out] ival integer value
527 @return DB_SUCCESS or error */
528ib_err_t ib_tuple_read_i16(ib_tpl_t ib_tpl, ib_ulint_t i, int16_t *ival);
529
530/** Read an unsigned int 16 bit column from an InnoDB tuple.
531 @param[in] ib_tpl InnoDB tuple
532 @param[in] i column number
533 @param[out] ival integer value
534 @return DB_SUCCESS or error */
535ib_err_t ib_tuple_read_u16(ib_tpl_t ib_tpl, ib_ulint_t i, uint16_t *ival);
536
537/** Read a signed int 32 bit column from an InnoDB tuple.
538 @param[in] ib_tpl InnoDB tuple
539 @param[in] i column number
540 @param[out] ival integer value
541 @return DB_SUCCESS or error */
542ib_err_t ib_tuple_read_i32(ib_tpl_t ib_tpl, ib_ulint_t i, int32_t *ival);
543
544/** Read an unsigned int 32 bit column from an InnoDB tuple.
545 @param[in] ib_tpl InnoDB tuple
546 @param[in] i column number
547 @param[out] ival integer value
548 @return DB_SUCCESS or error */
549ib_err_t ib_tuple_read_u32(ib_tpl_t ib_tpl, ib_ulint_t i, uint32_t *ival);
550
551/** Read a signed int 64 bit column from an InnoDB tuple.
552 @param[in] ib_tpl InnoDB tuple
553 @param[in] i column number
554 @param[out] ival integer value
555 @return DB_SUCCESS or error */
556ib_err_t ib_tuple_read_i64(ib_tpl_t ib_tpl, ib_ulint_t i, int64_t *ival);
557
558/** Read an unsigned int 64 bit column from an InnoDB tuple.
559 @param[in] ib_tpl InnoDB tuple
560 @param[in] i column number
561 @param[out] ival integer value
562 @return DB_SUCCESS or error */
563ib_err_t ib_tuple_read_u64(ib_tpl_t ib_tpl, ib_ulint_t i, uint64_t *ival);
564
565/** Get a column value pointer from the tuple.
566 @param[in] ib_tpl tuple instance
567 @param[in] i column index in tuple
568 @return NULL or pointer to buffer */
569const void *ib_col_get_value(ib_tpl_t ib_tpl, ib_ulint_t i);
570
571/** Get a column type, length and attributes from the tuple.
572 @param[in] ib_tpl InnoDB tuple
573 @param[in] i column number
574 @param[out] ib_col_meta column meta data
575 @return len of column data */
576uint64_t ib_col_get_meta(ib_tpl_t ib_tpl, ib_ulint_t i,
577 ib_col_meta_t *ib_col_meta);
578
579/** Create an InnoDB tuple used for index/table search.
580 @param[in] ib_crsr Cursor instance
581 @return tuple for current index */
583
584/** Create an InnoDB tuple used for table key operations.
585* @param[in] ib_crsr Cursor instance
586 @return tuple for current table */
588
589/** Create an InnoDB tuple for table row operations.
590 @param[in] ib_crsr Cursor instance
591 @return tuple for current table */
593
594/** Return the number of user columns in the tuple definition.
595 @param[in] ib_tpl Tuple for current table
596 @return number of user columns */
597uint64_t ib_tuple_get_n_user_cols(const ib_tpl_t ib_tpl);
598
599/** Return the number of columns in the tuple definition.
600 @param[in] ib_tpl Tuple for current table
601 @return number of columns */
602uint64_t ib_tuple_get_n_cols(const ib_tpl_t ib_tpl);
603
604/** Destroy an InnoDB tuple.
605 @param[in] ib_tpl Tuple for current table*/
606void ib_tuple_delete(ib_tpl_t ib_tpl);
607
608/** Check if cursor is positioned.
609 @param[in] ib_crsr InnoDB cursor instance
610 @return IB_true if positioned */
611bool ib_cursor_is_positioned(const ib_crsr_t ib_crsr);
612
613/** Checks if the data dictionary is latched in exclusive mode by a
614 user transaction.
615 @param[in] ib_trx transaction
616 @return true if exclusive latch */
617bool ib_schema_lock_is_exclusive(const ib_trx_t ib_trx);
618
619/** Lock an InnoDB cursor/table.
620 @param[in,out] ib_crsr InnoDB cursor
621 @param[in] ib_lck_mode InnoDB lock mode
622 @return DB_SUCCESS or error code */
623ib_err_t ib_cursor_lock(ib_crsr_t ib_crsr, ib_lck_mode_t ib_lck_mode);
624
625/** Set the Lock mode of the cursor.
626 @param[in,out] ib_crsr InnoDB cursor
627 @param[in] ib_lck_mode InnoDB lock mode
628 @return DB_SUCCESS or error code */
630
631/** Set need to access clustered index record flag.
632 @param[in,out] ib_crsr InnoDB cursor */
634
635/** Inform the cursor that it's the start of an SQL statement.
636 @param[in,out] ib_crsr InnoDB cursor */
637void ib_cursor_stmt_begin(ib_crsr_t ib_crsr);
638
639/** Get a column type, length and attributes from the tuple.
640 @param[in] ib_crsr InnoDB cursor instance
641 @param[in] i column index in tuple
642 @return len of column data */
643const char *ib_col_get_name(ib_crsr_t ib_crsr, ib_ulint_t i);
644
645/** Get an index field name from the cursor.
646 @param[in] ib_crsr InnoDB cursor instance
647 @param[in] i column index in tuple
648 @return name of the field */
649const char *ib_get_idx_field_name(ib_crsr_t ib_crsr, ib_ulint_t i);
650
651/** Get generic configure status
652 @return configure status*/
653int ib_cfg_get_cfg();
654
655/** Return isolation configuration set by "innodb_api_trx_level"
656 @return trx isolation level*/
658
659/** Return configure value for background commit interval (in seconds)
660 @return background commit interval (in seconds) */
662
663/** Get a trx start time.
664 @return trx start_time */
665uint64_t ib_trx_get_start_time(ib_trx_t ib_trx); /*!< in: transaction */
666
667/** Wrapper of ut_strerr() which converts an InnoDB error number to a
668 human readable text message.
669 @return string, describing the error */
670const char *ib_ut_strerr(ib_err_t num); /*!< in: error number */
671
672/** Get the SDI keys in a tablespace into vector.
673@param[in] tablespace_id tablespace id
674@param[in,out] ib_sdi_vector vector to hold objects with tablespace types
675and ids
676@param[in,out] trx data dictionary transaction
677@return DB_SUCCESS if SDI keys retrieval is successful, else error */
679 ib_trx_t trx);
680
681/** Retrieve SDI from tablespace
682@param[in] tablespace_id tablespace id
683@param[in] ib_sdi_key SDI key
684@param[in,out] comp_sdi in: buffer to hold the SDI BLOB
685 out: compressed SDI retrieved from tablespace
686@param[in,out] comp_sdi_len in: Size of memory allocated
687 out: compressed length of SDI
688@param[out] uncomp_sdi_len out: uncompressed length of SDI
689@param[in,out] trx innodb transaction
690@return DB_SUCCESS if SDI retrieval is successful, else error
691in case the passed buffer length is smaller than the actual SDI
692DB_OUT_OF_MEMORY is thrown and uncompressed length is set in
693uncomp_sdi_len */
694ib_err_t ib_sdi_get(uint32_t tablespace_id, const ib_sdi_key_t *ib_sdi_key,
695 void *comp_sdi, uint32_t *comp_sdi_len,
696 uint32_t *uncomp_sdi_len, ib_trx_t trx);
697
698/** Insert/Update SDI in tablespace
699@param[in] tablespace_id tablespace id
700@param[in] sdi_key SDI key to uniquely identify the tablespace
701 object
702@param[in] uncomp_len uncompressed length of SDI
703@param[in] comp_len compressed length of SDI
704@param[in] sdi compressed SDI to be stored in tablespace
705@param[in,out] trx innodb transaction
706@return DB_SUCCESS if SDI Insert/Update is successful, else error */
707ib_err_t ib_sdi_set(uint32_t tablespace_id, const ib_sdi_key_t *sdi_key,
708 uint32_t uncomp_len, uint32_t comp_len, const void *sdi,
709 ib_trx_t trx);
710
711/** Delete SDI from tablespace.
712@param[in] tablespace_id tablespace id
713@param[in] sdi_key SDI key to uniquely identify the tablespace
714object
715@param[in,out] trx innodb transaction
716@return DB_SUCCESS if SDI deletion is successful, else error */
717ib_err_t ib_sdi_delete(uint32_t tablespace_id, const ib_sdi_key_t *sdi_key,
718 ib_trx_t trx);
719
720/** Create SDI in a tablespace
721@param[in] tablespace_id InnoDB tablespace id
722@return DB_SUCCESS if SDI index creation is successful, else error */
723ib_err_t ib_sdi_create(space_id_t tablespace_id);
724
725/** Drop SDI Index from tablespace. This should be used only when SDI
726is corrupted.
727@param[in] tablespace_id InnoDB tablespace id
728@return DB_SUCCESS if dropping of SDI indexes is successful, else error */
729ib_err_t ib_sdi_drop(space_id_t tablespace_id);
730
731/** Check the table whether it contains virtual columns.
732@param[in] crsr InnoDB Cursor
733@return true if the table contains virtual column else failure. */
735
736#define FOR_EACH_API_METHOD_NAME_STEM(transform) \
737 transform(cursor_open_table) /**/ \
738 transform(cursor_read_row) /**/ \
739 transform(cursor_insert_row) /**/ \
740 transform(cursor_delete_row) /**/ \
741 transform(cursor_update_row) /**/ \
742 transform(cursor_moveto) /**/ \
743 transform(cursor_first) /**/ \
744 transform(cursor_next) /**/ \
745 transform(cursor_set_match_mode) /**/ \
746 transform(sec_search_tuple_create) /**/ \
747 transform(clust_read_tuple_create) /**/ \
748 transform(tuple_delete) /**/ \
749 transform(tuple_read_u8) /**/ \
750 transform(tuple_read_u16) /**/ \
751 transform(tuple_read_u32) /**/ \
752 transform(tuple_read_u64) /**/ \
753 transform(tuple_read_i8) /**/ \
754 transform(tuple_read_i16) /**/ \
755 transform(tuple_read_i32) /**/ \
756 transform(tuple_read_i64) /**/ \
757 transform(tuple_get_n_cols) /**/ \
758 transform(col_set_value) /**/ \
759 transform(col_get_value) /**/ \
760 transform(col_get_meta) /**/ \
761 transform(trx_begin) /**/ \
762 transform(trx_commit) /**/ \
763 transform(trx_rollback) /**/ \
764 transform(trx_start) /**/ \
765 transform(trx_release) /**/ \
766 transform(cursor_lock) /**/ \
767 transform(cursor_close) /**/ \
768 transform(cursor_new_trx) /**/ \
769 transform(cursor_reset) /**/ \
770 transform(col_get_name) /**/ \
771 transform(cursor_open_index_using_name) /**/ \
772 transform(cfg_get_cfg) /**/ \
773 transform(cursor_set_cluster_access) /**/ \
774 transform(cursor_commit_trx) /**/ \
775 transform(cfg_trx_level) /**/ \
776 transform(tuple_get_n_user_cols) /**/ \
777 transform(cursor_set_lock_mode) /**/ \
778 transform(get_idx_field_name) /**/ \
779 transform(trx_get_start_time) /**/ \
780 transform(cfg_bk_commit_interval) /**/ \
781 transform(ut_strerr) /**/ \
782 transform(cursor_stmt_begin) /**/ \
783 transform(trx_read_only) /**/ \
784 transform(is_virtual_table) /**/
785
786#endif /* api0api_h */
constexpr uint32_t IB_SQL_NULL
Represents SQL_NULL length.
Definition: api0api.h:358
void ib_tuple_delete(ib_tpl_t ib_tpl)
Destroy an InnoDB tuple.
Definition: api0api.cc:2325
ib_tpl_t ib_sec_search_tuple_create(ib_crsr_t ib_crsr)
Create an InnoDB tuple used for index/table search.
Definition: api0api.cc:2256
ib_err_t ib_sdi_delete(uint32_t tablespace_id, const ib_sdi_key_t *sdi_key, ib_trx_t trx)
Delete SDI from tablespace.
ib_cfg_type_t
Possible types for a configuration variable.
Definition: api0api.h:72
@ IB_CFG_ULINT
The configuration parameter is of type ulint.
Definition: api0api.h:88
@ IB_CFG_ULONG
The configuration parameter is of type ulong.
Definition: api0api.h:91
@ IB_CFG_TEXT
The configuration parameter is of type char*.
Definition: api0api.h:94
@ IB_CFG_CB
The configuration parameter is a callback parameter.
Definition: api0api.h:97
@ IB_CFG_BOOL
The configuration parameter is of type bool.
Definition: api0api.h:73
ib_err_t ib_cursor_first(ib_crsr_t ib_crsr)
Move cursor to the first record in the table.
Definition: api0api.cc:1675
dtuple_t * ib_tuple_to_dtuple(ib_tpl_t tuple)
Definition: api0api.cc:217
bool ib_is_virtual_table(ib_crsr_t crsr)
Check the table whether it contains virtual columns.
Definition: api0api.cc:874
ib_err_t ib_col_set_value(ib_tpl_t ib_tpl, ib_ulint_t col_no, const void *src, uint64_t len, bool need_cpy)
Set a column of the tuple.
Definition: api0api.cc:1799
ib_err_t ib_cursor_moveto(ib_crsr_t ib_crsr, ib_tpl_t ib_tpl, ib_srch_mode_t ib_srch_mode, uint64_t direction)
Search for key.
Definition: api0api.cc:1705
uint64_t ib_trx_get_start_time(ib_trx_t ib_trx)
Get a trx start time.
Definition: api0api.cc:563
ib_err_t ib_tuple_read_i64(ib_tpl_t ib_tpl, ib_ulint_t i, int64_t *ival)
Read a signed int 64 bit column from an InnoDB tuple.
Definition: api0api.cc:2216
ib_tpl_t ib_clust_search_tuple_create(ib_crsr_t ib_crsr)
Create an InnoDB tuple used for table key operations.
Definition: api0api.cc:2269
enum dberr_t ib_err_t
All InnoDB error codes are represented by ib_err_t.
Definition: api0api.h:56
ib_err_t ib_tuple_read_i16(ib_tpl_t ib_tpl, ib_ulint_t i, int16_t *ival)
Read a signed int 16 bit column from an InnoDB tuple.
Definition: api0api.cc:2168
constexpr uint32_t IB_CFG_BINLOG_ENABLED
Definition: api0api.h:296
unsigned char ib_byte_t
Representation of a byte within InnoDB.
Definition: api0api.h:58
ib_err_t ib_trx_rollback(ib_trx_t ib_trx)
Rollback a transaction.
Definition: api0api.cc:601
row_prebuilt_t * ib_cursor_get_row_prebuilt(ib_crsr_t cursor)
Definition: api0api.cc:219
uint64_t ib_tuple_get_n_user_cols(const ib_tpl_t ib_tpl)
Return the number of user columns in the tuple definition.
Definition: api0api.cc:2302
struct ib_cursor_t * ib_crsr_t
InnoDB cursor handle.
Definition: api0api.h:337
constexpr uint32_t IB_CFG_MDL_ENABLED
Definition: api0api.h:297
FILE * ib_msg_stream_t
The first argument to the InnoDB message logging function.
Definition: api0api.h:307
ib_err_t ib_sdi_drop(space_id_t tablespace_id)
Drop SDI Index from tablespace.
Definition: api0api.cc:2901
ib_err_t ib_cursor_open_index_using_name(ib_crsr_t ib_open_crsr, const char *index_name, ib_crsr_t *ib_crsr, int *idx_type, ib_id_u64_t *idx_id)
Open an InnoDB secondary index cursor and return a cursor handle to it.
Definition: api0api.cc:757
ib_err_t ib_cursor_update_row(ib_crsr_t ib_crsr, const ib_tpl_t ib_old_tpl, const ib_tpl_t ib_new_tpl)
Update a row in a table.
Definition: api0api.cc:1405
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:49
void ib_cursor_set_match_mode(ib_crsr_t ib_crsr, ib_match_mode_t match_mode)
Set the match mode for ib_cursor_move().
Definition: api0api.cc:1762
static const size_t REC_BUF_SLOT_SIZE
Used by ib_read_tuple to determine number of bytes to allocate for new slot if needed.
Definition: api0api.h:302
ib_err_t ib_cursor_close(ib_crsr_t ib_crsr)
Close an InnoDB table and free the cursor.
Definition: api0api.cc:956
ib_err_t ib_cursor_insert_row(ib_crsr_t ib_crsr, const ib_tpl_t ib_tpl)
Insert a row to a table.
Definition: api0api.cc:1107
ib_err_t ib_sdi_create(space_id_t tablespace_id)
Create SDI in a tablespace.
Definition: api0api.cc:2864
ib_tbl_fmt_t
InnoDB table format types.
Definition: api0api.h:144
@ IB_TBL_COMPRESSED
Similar to dynamic format but with pages compressed.
Definition: api0api.h:159
@ IB_TBL_DYNAMIC
Compact row format.
Definition: api0api.h:156
@ IB_TBL_COMPACT
Compact row format, the column type is not stored in the row.
Definition: api0api.h:148
@ IB_TBL_REDUNDANT
Redundant row format, the column type and length is stored in the row.
Definition: api0api.h:145
ib_err_t ib_cursor_lock(ib_crsr_t ib_crsr, ib_lck_mode_t ib_lck_mode)
Lock an InnoDB cursor/table.
Definition: api0api.cc:2357
ib_err_t ib_tuple_read_u16(ib_tpl_t ib_tpl, ib_ulint_t i, uint16_t *ival)
Read an unsigned int 16 bit column from an InnoDB tuple.
Definition: api0api.cc:2180
ib_err_t ib_sdi_set(uint32_t tablespace_id, const ib_sdi_key_t *sdi_key, uint32_t uncomp_len, uint32_t comp_len, const void *sdi, ib_trx_t trx)
Insert/Update SDI in tablespace.
ib_err_t ib_sdi_get(uint32_t tablespace_id, const ib_sdi_key_t *ib_sdi_key, void *comp_sdi, uint32_t *comp_sdi_len, uint32_t *uncomp_sdi_len, ib_trx_t trx)
Retrieve SDI from tablespace.
uint64_t ib_col_get_meta(ib_tpl_t ib_tpl, ib_ulint_t i, ib_col_meta_t *ib_col_meta)
Get a column type, length and attributes from the tuple.
Definition: api0api.cc:2095
constexpr uint32_t IB_CFG_DISABLE_ROWLOCK
Definition: api0api.h:298
ib_tpl_t ib_clust_read_tuple_create(ib_crsr_t ib_crsr)
Create an InnoDB tuple for table row operations.
Definition: api0api.cc:2287
ib_err_t ib_cursor_commit_trx(ib_crsr_t ib_crsr, ib_trx_t ib_trx)
Commit the transaction in a cursor.
Definition: api0api.cc:939
ib_err_t ib_cursor_new_trx(ib_crsr_t ib_crsr, ib_trx_t ib_trx)
update the cursor with new transactions and also reset the cursor
Definition: api0api.cc:915
ib_err_t ib_tuple_read_i8(ib_tpl_t ib_tpl, ib_ulint_t i, int8_t *ival)
Read a signed int 8 bit column from an InnoDB tuple.
Definition: api0api.cc:2144
bool ib_cursor_is_positioned(const ib_crsr_t ib_crsr)
Check if cursor is positioned.
Definition: api0api.cc:2339
uint64_t ib_cfg_bk_commit_interval()
Return configure value for background commit interval (in seconds)
Definition: api0api.cc:2421
bool ib_schema_lock_is_exclusive(const ib_trx_t ib_trx)
Checks if the data dictionary is latched in exclusive mode by a user transaction.
Definition: api0api.cc:2348
ib_trx_t ib_trx_begin(ib_trx_level_t ib_trx_level, bool read_write, bool auto_commit, void *thd)
Begin a transaction.
Definition: api0api.cc:534
ib_match_mode_t
Various match modes used by ib_cursor_moveto()
Definition: api0api.h:237
@ IB_EXACT_MATCH
Search using a complete key value.
Definition: api0api.h:240
@ IB_EXACT_PREFIX
Search using a key prefix which must match to rows: the prefix may contain an incomplete field (the l...
Definition: api0api.h:243
@ IB_CLOSEST_MATCH
Closest match possible.
Definition: api0api.h:238
ib_err_t ib_cursor_reset(ib_crsr_t ib_crsr)
Reset the cursor.
Definition: api0api.cc:894
uint64_t ib_tuple_get_n_cols(const ib_tpl_t ib_tpl)
Return the number of columns in the tuple definition.
Definition: api0api.cc:2316
ib_trx_level_t
Transaction isolation levels.
Definition: api0api.h:266
@ IB_TRX_SERIALIZABLE
All plain SELECTs are converted to LOCK IN SHARE MODE reads.
Definition: api0api.h:289
@ IB_TRX_READ_COMMITTED
Somewhat Oracle-like isolation, except that in range UPDATE and DELETE we must block phantom rows wit...
Definition: api0api.h:274
@ IB_TRX_READ_UNCOMMITTED
Dirty read: non-locking SELECTs are performed so that we do not look at a possible earlier version of...
Definition: api0api.h:267
@ IB_TRX_REPEATABLE_READ
All consistent reads in the same trx read the same snapshot; full next-key locking used in locking re...
Definition: api0api.h:284
ib_col_type_t
column types that are supported.
Definition: api0api.h:102
@ IB_DECIMAL
C (double) floating point value.
Definition: api0api.h:134
@ IB_INT
Integer: can be any size from 1 - 8 bytes.
Definition: api0api.h:118
@ IB_DOUBLE
Definition: api0api.h:132
@ IB_SYS
System column, this column can be one of DATA_TRX_ID, DATA_ROLL_PTR or DATA_ROW_ID.
Definition: api0api.h:126
@ IB_VARBINARY
Variable length binary.
Definition: api0api.h:113
@ IB_CHAR_ANYCHARSET
Any charset, fixed length.
Definition: api0api.h:139
@ IB_BINARY
Fixed length binary, similar to IB_CHAR but the column is not padded to the right.
Definition: api0api.h:109
@ IB_VARCHAR
Character varying length.
Definition: api0api.h:103
@ IB_FLOAT
C (float) floating point value.
Definition: api0api.h:130
@ IB_CHAR
Fixed length character string.
Definition: api0api.h:106
@ IB_BLOB
Binary large object, or a TEXT type.
Definition: api0api.h:115
@ IB_VARCHAR_ANYCHARSET
Any charset, varying length.
Definition: api0api.h:137
struct ib_tuple_t * ib_tpl_t
InnoDB tuple handle.
Definition: api0api.h:323
void * ib_opaque_t
Definition: api0api.h:67
uint64_t ib_col_copy_value(ib_tpl_t ib_tpl, ib_ulint_t i, void *dst, uint32_t len)
Copy a column value from the tuple.
Definition: api0api.cc:1973
ib_err_t ib_tuple_read_u8(ib_tpl_t ib_tpl, ib_ulint_t i, uint8_t *ival)
Read an unsigned int 8 bit column from an InnoDB tuple.
Definition: api0api.cc:2156
ib_col_attr_t
InnoDB column attributes.
Definition: api0api.h:164
@ IB_COL_NONE
No special attributes.
Definition: api0api.h:165
@ IB_COL_NOT_USED
Future use, reserved.
Definition: api0api.h:171
@ IB_COL_CUSTOM3
Custom precision type, this is a bit that is ignored by InnoDB and so can be set and queried by users...
Definition: api0api.h:181
@ IB_COL_CUSTOM1
Custom precision type, this is a bit that is ignored by InnoDB and so can be set and queried by users...
Definition: api0api.h:173
@ IB_COL_CUSTOM2
Custom precision type, this is a bit that is ignored by InnoDB and so can be set and queried by users...
Definition: api0api.h:177
@ IB_COL_UNSIGNED
Column is IB_INT and unsigned.
Definition: api0api.h:169
@ IB_COL_NOT_NULL
Column data can't be NULL.
Definition: api0api.h:167
ib_opaque_t ib_charset_t
Definition: api0api.h:68
ib_err_t ib_cursor_next(ib_crsr_t ib_crsr)
Move cursor to the next record in the table.
Definition: api0api.cc:1684
void ib_cursor_stmt_begin(ib_crsr_t ib_crsr)
Inform the cursor that it's the start of an SQL statement.
Definition: api0api.cc:2406
ib_err_t ib_tuple_read_i32(ib_tpl_t ib_tpl, ib_ulint_t i, int32_t *ival)
Read a signed int 32 bit column from an InnoDB tuple.
Definition: api0api.cc:2192
ib_lck_mode_t
InnoDB lock modes.
Definition: api0api.h:188
@ IB_LOCK_X
Exclusive locks should be used to lock rows.
Definition: api0api.h:198
@ IB_LOCK_IS
Intention shared, an intention lock should be used to lock tables.
Definition: api0api.h:189
@ IB_LOCK_TABLE_X
exclusive table lock
Definition: api0api.h:201
@ IB_LOCK_IX
Intention exclusive, an intention lock should be used to lock tables.
Definition: api0api.h:192
@ IB_LOCK_S
Shared locks should be used to lock rows.
Definition: api0api.h:195
@ IB_LOCK_NONE
This is used internally to note consistent read.
Definition: api0api.h:203
@ IB_LOCK_NUM
number of lock modes
Definition: api0api.h:206
const char * ib_get_idx_field_name(ib_crsr_t ib_crsr, ib_ulint_t i)
Get an index field name from the cursor.
Definition: api0api.cc:2080
ib_err_t ib_cursor_set_lock_mode(ib_crsr_t ib_crsr, ib_lck_mode_t ib_lck_mode)
Set the Lock mode of the cursor.
Definition: api0api.cc:2371
ib_trx_level_t ib_cfg_trx_level()
Return isolation configuration set by "innodb_api_trx_level".
Definition: api0api.cc:2415
uint32_t ib_trx_read_only(ib_trx_t ib_trx)
Check if the transaction is read_only.
Definition: api0api.cc:555
int(* ib_msg_log_t)(ib_msg_stream_t, const char *,...)
All log messages are written to this function.It should have the same behavior as fprintf(3).
Definition: api0api.h:311
ib_err_t ib_tuple_read_u32(ib_tpl_t ib_tpl, ib_ulint_t i, uint32_t *ival)
Read an unsigned int 32 bit column from an InnoDB tuple.
Definition: api0api.cc:2204
ib_err_t ib_sdi_get_keys(uint32_t tablespace_id, ib_sdi_vector_t *ib_sdi_vector, ib_trx_t trx)
Get the SDI keys in a tablespace into vector.
const char * ib_ut_strerr(ib_err_t num)
Wrapper of ut_strerr() which converts an InnoDB error number to a human readable text message.
Definition: api0api.cc:2444
uint64_t ib_id_u64_t
Definition: api0api.h:69
int(* ib_client_cmp_t)(const ib_col_meta_t *col_meta, const ib_byte_t *p1, uint64_t p1_len, const ib_byte_t *p2, uint64_t p2_len)
This function is used to compare two data fields for which the data type is such that we must use the...
Definition: api0api.h:352
uint32_t page_no_t
Page number.
Definition: api0api.h:47
ib_err_t ib_cursor_delete_row(ib_crsr_t ib_crsr)
Delete a row in a table.
Definition: api0api.cc:1508
ib_err_t ib_cursor_read_row(ib_crsr_t ib_crsr, ib_tpl_t ib_tpl, ib_tpl_t cmp_tpl, int mode, void **row_buf, uint64_t *row_len, uint64_t *used_len)
Read current row.
Definition: api0api.cc:1576
ib_err_t ib_tuple_read_u64(ib_tpl_t ib_tpl, ib_ulint_t i, uint64_t *ival)
Read an unsigned int 64 bit column from an InnoDB tuple.
Definition: api0api.cc:2228
ib_err_t ib_trx_start(ib_trx_t ib_trx, ib_trx_level_t ib_trx_level, bool read_write, bool auto_commit, void *thd)
Start a transaction that's been rolled back.
Definition: api0api.cc:502
void(* ib_cb_t)(void)
Generical InnoDB callback prototype.
Definition: api0api.h:294
ib_err_t ib_cursor_open_table(const char *name, ib_trx_t ib_trx, ib_crsr_t *ib_crsr)
Open an InnoDB table by name and return a cursor handle to it.
Definition: api0api.cc:822
int ib_cfg_get_cfg()
Get generic configure status.
Definition: api0api.cc:2425
ib_err_t ib_trx_commit(ib_trx_t ib_trx)
Commit a transaction.
Definition: api0api.cc:584
const void * ib_col_get_value(ib_tpl_t ib_tpl, ib_ulint_t i)
Get a column value pointer from the tuple.
Definition: api0api.cc:2240
struct trx_t * ib_trx_t
InnoDB transaction handle, all database operations need to be covered by transactions.
Definition: api0api.h:334
ib_index_type_t
Definition: api0api.h:209
@ IB_UNIQUE
unique index
Definition: api0api.h:211
@ IB_CLUSTERED
clustered index
Definition: api0api.h:210
ib_err_t ib_trx_release(ib_trx_t ib_trx)
Release the resources of the transaction.
Definition: api0api.cc:571
ib_srch_mode_t
InnoDB cursor search modes for ib_cursor_moveto().
Definition: api0api.h:216
@ IB_CUR_L
If search key is not found then position the cursor on the row that is less than the search key.
Definition: api0api.h:226
@ IB_CUR_GE
If the search key not found then position the cursor on the row that is greater than or equal to the ...
Definition: api0api.h:221
@ IB_CUR_G
If search key is not found then position the cursor on the row that is greater than the search key.
Definition: api0api.h:217
@ IB_CUR_LE
If search key is not found then position the cursor on the row that is less than or equal to the sear...
Definition: api0api.h:230
void ib_cursor_set_cluster_access(ib_crsr_t ib_crsr)
Set need to access clustered index record flag.
Definition: api0api.cc:2396
const char * ib_col_get_name(ib_crsr_t ib_crsr, ib_ulint_t i)
Get a column type, length and attributes from the tuple.
Definition: api0api.cc:2068
unsigned long int ib_ulint_t
Representation of an unsigned long int within InnoDB.
Definition: api0api.h:64
SQL data field and tuple.
Global error codes for the database.
dberr_t
Definition: db0err.h:39
const std::string FILE("FILE")
mode
Definition: file_handle.h:61
case opt name
Definition: sslopt-case.h:29
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:696
InnoDB column meta data.
Definition: api0api.h:251
ib_col_type_t type
Type of the column.
Definition: api0api.h:252
ib_charset_t * charset
Column charset.
Definition: api0api.h:261
uint32_t type_len
Length of type.
Definition: api0api.h:256
ib_col_attr_t attr
Column attributes.
Definition: api0api.h:254
uint16_t client_type
16 bits of data relevant only to the client.
Definition: api0api.h:258
Cursor instance for traversing tables/indexes.
Definition: api0api.cc:127
Definition: api0misc.h:61
Definition: api0misc.h:65
InnoDB tuple used for key operations.
Definition: api0api.cc:203
A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; th...
Definition: row0mysql.h:515
trx_t * trx
current transaction handle
Definition: row0mysql.h:525
Definition: trx0trx.h:675