MySQL 8.4.2
Source Code Documentation
my_base.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24/**
25 @file include/my_base.h
26 This file includes constants used by all storage engines.
27*/
28
29#ifndef _my_base_h
30#define _my_base_h
31
32#include <limits.h>
33#include <sys/types.h>
34
35#include "my_config.h"
36#include "my_double2ulonglong.h"
37#include "my_inttypes.h"
38#include "my_macros.h"
39
40/* The following is bits in the flag parameter to ha_open() */
41
42#define HA_OPEN_ABORT_IF_LOCKED 0 /* default */
43#define HA_OPEN_WAIT_IF_LOCKED 1
44#define HA_OPEN_IGNORE_IF_LOCKED 2
45#define HA_OPEN_TMP_TABLE 4 /* Table is a temp table */
46#define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */
47#define HA_OPEN_ABORT_IF_CRASHED 16
48#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */
49#define HA_OPEN_FROM_SQL_LAYER 64
50#define HA_OPEN_COPY 256 /* Open copy (for repair) */
51/**
52 Internal temp table, used for temporary results; one or more instance of it
53 may be be created.
54*/
55#define HA_OPEN_INTERNAL_TABLE 512
56
57/* The following is parameter to ha_rkey() how to use key */
58
59/*
60 We define a complete-field prefix of a key value as a prefix where
61 the last included field in the prefix contains the full field, not
62 just some bytes from the start of the field. A partial-field prefix
63 is allowed to contain only a few first bytes from the last included
64 field.
65
66 Below HA_READ_KEY_EXACT, ..., HA_READ_BEFORE_KEY can take a
67 complete-field prefix of a key value as the search
68 key. HA_READ_PREFIX and HA_READ_PREFIX_LAST could also take a
69 partial-field prefix, but currently (4.0.10) they are only used with
70 complete-field prefixes. MySQL uses a padding trick to implement
71 LIKE 'abc%' queries.
72
73 NOTE that in InnoDB HA_READ_PREFIX_LAST will NOT work with a
74 partial-field prefix because InnoDB currently strips spaces from the
75 end of varchar fields!
76*/
77
79 HA_READ_KEY_EXACT, /* Find first record else error */
80 HA_READ_KEY_OR_NEXT, /* Record or next record */
81 HA_READ_KEY_OR_PREV, /* Record or previous */
82 HA_READ_AFTER_KEY, /* Find next rec. after key-record */
83 HA_READ_BEFORE_KEY, /* Find next rec. before key-record */
84 HA_READ_PREFIX, /* Key which as same prefix */
85 HA_READ_PREFIX_LAST, /* Last key with the same prefix */
86 HA_READ_PREFIX_LAST_OR_PREV, /* Last or prev key with the same prefix */
87 HA_READ_MBR_CONTAIN, /* Minimum Bounding Rectangle contains */
88 HA_READ_MBR_INTERSECT, /* Minimum Bounding Rectangle intersect */
89 HA_READ_MBR_WITHIN, /* Minimum Bounding Rectangle within */
90 HA_READ_MBR_DISJOINT, /* Minimum Bounding Rectangle disjoint */
91 HA_READ_MBR_EQUAL, /* Minimum Bounding Rectangle equal */
92 HA_READ_NEAREST_NEIGHBOR, /* Nearest Neighbor search */
93 HA_READ_INVALID = -1 /* Invalid enumeration value, always last. */
94};
95
96/* Key algorithm types */
97
99 /**
100 Used for cases when key algorithm which is supported by SE can't be
101 described by one of other classes from this enum (@sa Federated,
102 PerfSchema SE, @sa dd::Index::IA_SE_SPECIFIC).
103
104 @note Assigned as default value for key algorithm by parser, replaced by
105 SEs default algorithm for keys in mysql_prepare_create_table().
106 */
108 HA_KEY_ALG_BTREE = 1, /* B-tree. */
109 HA_KEY_ALG_RTREE = 2, /* R-tree, for spatial searches */
110 HA_KEY_ALG_HASH = 3, /* HASH keys (HEAP, NDB). */
111 HA_KEY_ALG_FULLTEXT = 4 /* FULLTEXT. */
113
114/* Storage media types */
115
117 HA_SM_DEFAULT = 0, /* Not specified (engine default) */
118 HA_SM_DISK = 1, /* DISK storage */
119 HA_SM_MEMORY = 2 /* MAIN MEMORY storage */
121
122/* The following is parameter to ha_extra() */
123
124/*
125 We divide the HA_EXTRA entries into the following categories:
126
127 1) Operations used by most handlers:
128 HA_EXTRA_KEYREAD
129 HA_EXTRA_NO_KEYREAD
130 HA_EXTRA_FLUSH
131 HA_EXTRA_PREPARE_FOR_RENAME
132 HA_EXTRA_FORCE_REOPEN
133
134 2) Operations used by some non-MyISAM handlers
135 HA_EXTRA_KEYREAD_PRESERVE_FIELDS
136 HA_EXTRA_IGNORE_DUP_KEY
137 HA_EXTRA_NO_IGNORE_DUP_KEY
138
139 3) Operations used only by MyISAM
140 HA_EXTRA_NORMAL
141 HA_EXTRA_QUICK
142 HA_EXTRA_PREPARE_FOR_UPDATE
143 HA_EXTRA_PREPARE_FOR_DROP
144 HA_EXTRA_READCHECK
145 HA_EXTRA_NO_READCHECK
146
147 4) Operations only used by temporary tables for query processing
148 HA_EXTRA_RESET_STATE
149 HA_EXTRA_NO_ROWS
150
151 5) Operations only used by MyISAM internally
152 HA_EXTRA_NO_USER_CHANGE
153 HA_EXTRA_WAIT_LOCK
154 HA_EXTRA_WAIT_NOLOCK
155 HA_EXTRA_NO_KEYS
156 HA_EXTRA_KEYREAD_CHANGE_POS
157 HA_EXTRA_REMEMBER_POS
158 HA_EXTRA_RESTORE_POS
159 HA_EXTRA_PRELOAD_BUFFER_SIZE
160 HA_EXTRA_CHANGE_KEY_TO_DUP
161 HA_EXTRA_CHANGE_KEY_TO_UNIQUE
162
163 6) Operations only used by federated tables for query processing
164 HA_EXTRA_INSERT_WITH_UPDATE
165
166 7) Operations only used by NDB
167 HA_EXTRA_DELETE_CANNOT_BATCH
168 HA_EXTRA_UPDATE_CANNOT_BATCH
169
170 8) Operations only used by MERGE
171 HA_EXTRA_ADD_CHILDREN_LIST
172 HA_EXTRA_ATTACH_CHILDREN
173 HA_EXTRA_IS_ATTACHED_CHILDREN
174 HA_EXTRA_DETACH_CHILDREN
175
176 9) Operations only used by InnoDB
177 HA_EXTRA_EXPORT
178
179 10) Operations only used by partitioning
180 HA_EXTRA_SECONDARY_SORT_ROWID
181
182 The individual entries are described in more detail below.
183*/
184
186 /*
187 Optimize for space (def).
188 Only used in MyISAM to reset quick mode, not implemented by any other
189 handler. Quick mode is also reset in MyISAM by handler::reset().
190
191 It is called after completing a successful DELETE query if the QUICK
192 option is set.
193 */
195 /*
196 Optimize for speed.
197 When the user does DELETE QUICK FROM table where-clause; this extra
198 option is called before the delete query is performed and
199 HA_EXTRA_NORMAL is called after the delete query is completed.
200 Temporary tables used internally in MySQL always set this option
201
202 The meaning of quick mode is that when deleting in a B-tree no merging
203 of leafs is performed. This is a common method and many large DBMS's
204 actually only support this quick mode since it is very difficult to
205 merge leaves in a tree used by many threads concurrently.
206 */
209 /*
210 Only one call to HA_EXTRA_NO_READCHECK from ha_open where it says that
211 this is not needed in SQL. The reason for this call is that MyISAM sets
212 the READ_CHECK_USED in the open call so the call is needed for MyISAM
213 to reset this feature.
214 The idea with this parameter was to inform of doing/not doing a read
215 check before applying an update. Since SQL always performs a read before
216 applying the update No Read Check is needed in MyISAM as well.
217
218 This is a cut from Docs/myisam.txt
219 Sometimes you might want to force an update without checking whether
220 another user has changed the record since you last read it. This is
221 somewhat dangerous, so it should ideally not be used. That can be
222 accomplished by wrapping the mi_update() call in two calls to mi_extra(),
223 using the flags HA_EXTRA_NO_READCHECK and HA_EXTRA_READCHECK.
224 */
227 /*
228 These parameters are used to provide an optimisation hint to the handler.
229 If HA_EXTRA_KEYREAD is set it is enough to read the index fields, for
230 many handlers this means that the index-only scans can be used and it
231 is not necessary to use the real records to satisfy this part of the
232 query. Index-only scans is a very important optimisation for disk-based
233 indexes. For main-memory indexes most indexes contain a reference to the
234 record and thus KEYREAD only says that it is enough to read key fields.
235 HA_EXTRA_NO_KEYREAD disables this for the handler, also, handler::reset()
236 will disable this option.
237 The handler will set HA_KEYREAD_ONLY in its table flags to indicate this
238 feature is supported.
239 */
242 /*
243 No user is allowed to write. Only used by MyISAM, never called.
244 Simulates lock_type as locked.
245 */
247 /*
248 Only used by MyISAM, called from MyISAM handler but never from server
249 code on top of the handler.
250 Sets lock_wait on/off:
251 Wait until file is available (def).
252 If file is locked, return quickly.
253 */
256 /*
257 Remove all update of keys. Only used by MyISAM, only used internally in
258 MyISAM handler, never called from server level.
259 */
261 HA_EXTRA_KEYREAD_CHANGE_POS = 17, /* Keyread, but change pos */
262 /* xxxxchk -r must be used */
263 HA_EXTRA_REMEMBER_POS = 18, /* Remember pos for next/prev */
265 /*
266 Only used by MyISAM and Archive, called when altering table,
267 closing tables to enforce a reopen of the table files.
268 */
270 /*
271 Indication to flush tables to disk, is supposed to be used to
272 ensure disk based tables are flushed at end of query execution.
273 Currently is never used.
274 */
276 /*
277 Don't insert rows indication to HEAP and MyISAM, only used by temporary
278 tables used in query processing.
279 */
281 /*
282 This option is used by most handlers and it resets the handler state
283 to the same state as after an open call.
284
285 It is called from the reset method in the handler interface. There are
286 three instances where this is called.
287
288 1) After completing a INSERT ... SELECT ... query the handler for the
289 table inserted into is reset
290 2) It is called from close_thread_table which in turn is called from
291 close_thread_tables except in the case where the tables are locked
292 in which case ha_commit_stmt is called instead.
293 It is only called from here if refresh_version hasn't changed and the
294 table is not an old table when calling close_thread_table.
295 close_thread_tables is called from many places as a general clean up
296 function after completing a query.
297 3) It is called when deleting the IndexRangeScanIterator object if the
298 IndexRangeScanIterator object had its own handler object. It is called
299 immediately before close of this local handler object.
300
301 If there is a READ CACHE it is reinit'ed. A cache is reinit'ed to
302 restart reading or to change type of cache between READ CACHE and
303 WRITE CACHE.
304
305 This extra function is always called immediately before calling
306 delete_all_rows on the handler for temporary tables.
307 There are cases however when HA_EXTRA_RESET_STATE isn't called in
308 a similar case for a temporary table in sql_union.cc.
309
310 The only case that delete_all_rows is called on non-temporary tables
311 is in sql_delete.cc when DELETE FROM table; is called by a user.
312 In this case no special extra calls are performed before or after this
313 call.
314 */
316 /*
317 Informs the handler that we will not stop the transaction if we get
318 duplicate key errors during insert/update.
319 Always called in pair, triggered by INSERT IGNORE and other similar
320 SQL constructs.
321 Not used by MyISAM.
322 */
325 /*
326 Only used by MyISAM, called in preparation for a DROP TABLE.
327 It's used mostly by Windows that cannot handle dropping an open file.
328 On other platforms it has the same effect as HA_EXTRA_FORCE_REOPEN.
329 */
331 /*
332 Remove read cache if problems.
333 This is called as part of a multi-table update. When the table to be
334 updated is also scanned then this informs MyISAM handler to drop any
335 caches if dynamic records are used (fixed size records do not care
336 about this call).
337 */
339 HA_EXTRA_PRELOAD_BUFFER_SIZE, /* Set buffer size for preloading */
340 /*
341 On-the-fly switching between unique and non-unique key inserting.
342 */
345 /*
346 When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep
347 other fields intact. When this is off (by default) InnoDB will use memcpy
348 to overwrite entire row.
349 This is a strictly InnoDB feature that is more or less undocumented.
350 */
352 /*
353 Ignore if the a tuple is not found, continue processing the
354 transaction and ignore that 'row'. Needed for idempotency
355 handling on the slave
356
357 Currently only used by NDB storage engine.
358 */
361 /*
362 Mark the table as a log table. For some handlers (e.g. CSV) this results
363 in a special locking for the table.
364 */
366 /*
367 Informs handler that write_row() which tries to insert new row into the
368 table and encounters some already existing row with same primary/unique
369 key can replace old row with new row instead of reporting error (basically
370 it informs handler that we do REPLACE instead of simple INSERT).
371 Off by default.
372 */
375 /*
376 Inform handler that delete_row()/update_row() cannot batch deletes/updates
377 and should perform them immediately. This may be needed when table has
378 AFTER DELETE/UPDATE triggers which access to subject table.
379 These flags are reset by the handler::reset() call.
380 */
383 /*
384 Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be
385 executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
386 */
388 /*
389 Informs the handler we are about to attempt a rename of the table.
390 For handlers that have share open files (MyISAM key-file and
391 Archive writer) they must close the files before rename is possible
392 on Windows.
393 */
395 /*
396 Special actions for MERGE tables.
397 */
402 /*
403 Prepare table for export
404 (e.g. quiesce the table and write table metadata).
405 */
407 /** Do secondary sort by handler::ref (rowid) after key sort. */
409 /** Skip acquiring locks when reading from ACL tables or views on DD
410 tables in order to make such reads non blocking. */
412 /* Begin of insertion into intermediate table during copy alter operation. */
414 /* Insertion is done in intermediate table during copy alter operation. */
416 /* Do not use auto-increment locking. */
418 /*
419 Allocate and use unique filter to weed out duplicates.
420 Used with multi-valued index.
421 */
423 /* Disable and free unique record filter. */
426
427/* Compatible option, to be deleted in 6.0 */
428#define HA_EXTRA_PREPARE_FOR_DELETE HA_EXTRA_PREPARE_FOR_DROP
429
430/* The following is parameter to ha_panic() */
431
433 HA_PANIC_CLOSE, /* Close all databases */
434 HA_PANIC_WRITE, /* Unlock and write status */
435 HA_PANIC_READ /* Lock and read keyinfo */
437
438/* The following is parameter to ha_create(); keytypes */
439
442 HA_KEYTYPE_TEXT = 1, /* Key is sorted as letters */
443 HA_KEYTYPE_BINARY = 2, /* Key is sorted as unsigned chars */
448 HA_KEYTYPE_NUM = 7, /* Not packed num with pre-space */
456 /* Varchar (0-255 bytes) with length packed with 1 byte */
457 HA_KEYTYPE_VARTEXT1 = 15, /* Key is sorted as letters */
458 HA_KEYTYPE_VARBINARY1 = 16, /* Key is sorted as unsigned chars */
459 /* Varchar (0-65535 bytes) with length packed with 2 bytes */
460 HA_KEYTYPE_VARTEXT2 = 17, /* Key is sorted as letters */
461 HA_KEYTYPE_VARBINARY2 = 18, /* Key is sorted as unsigned chars */
462 HA_KEYTYPE_BIT = 19
464
465#define HA_MAX_KEYTYPE 31 /* Must be log2-1 */
466
467/*
468 Flags for KEY::flags bitmap.
469
470 Also used for similar bitmaps in storage engines (HP_KEYDEF::flag,
471 MI_KEYDEF::flag, ...).
472*/
473
474/** Do not allow duplicate records. */
475#define HA_NOSAME 1
476/** Pack string key to previous key (optimization supported by MyISAM). */
477#define HA_PACK_KEY (1 << 1)
478/*
479 Bits in KEY::flags, MI/HP_KEYDEF::flag which are automatically
480 calculated based on other flags/members in these structures
481 (often from info about key parts).
482*/
483/** Some key part packs space. Internal to MyISAM. */
484#define HA_SPACE_PACK_USED (1 << 2)
485/** Some key part has variable length. Internal to MyISAM and Heap engines. */
486#define HA_VAR_LENGTH_KEY (1 << 3)
487/**
488 Auto-increment key.
489
490 @note Not used by SQL-layer/ for KEY::flags. Only set by MyISAM and
491 Heap SEs in MI/HP_KEYDEF::flag.
492*/
493#define HA_AUTO_KEY (1 << 4)
494/** Packing of all keys to previous key (optimization supported by MyISAM). */
495#define HA_BINARY_PACK_KEY (1 << 5)
496/** Some key part is nullable. */
497#define HA_NULL_PART_KEY (1 << 6)
498/** Full-text key. */
499#define HA_FULLTEXT (1 << 7)
500/**
501 Flag in MI_KEYDEF::flag which marks MyISAM's "uniques".
502
503 @note Internal to MyISAM. Current server doesn't use this feature.
504*/
505#define HA_UNIQUE_CHECK (1 << 8)
506/** Internal bit used when sorting records. Internal to MyISAM. */
507#define HA_SORT_ALLOWS_SAME (1 << 9)
508/** Spatial key. */
509#define HA_SPATIAL (1 << 10)
510/**
511 NULLs in key are compared as equal.
512
513 @note Used only for internal temporary tables created by optimizer.
514*/
515#define HA_NULL_ARE_EQUAL (1 << 11)
516/** Key has comment. */
517#define HA_USES_COMMENT (1 << 12)
518/** Key was automatically created to support Foreign Key constraint. */
519#define HA_GENERATED_KEY (1 << 13)
520
521/* The combination of the above can be used for key type comparison. */
522#define HA_KEYFLAG_MASK \
523 (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | HA_BINARY_PACK_KEY | HA_FULLTEXT | \
524 HA_UNIQUE_CHECK | HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY)
525
526/** Fulltext index uses [pre]parser */
527#define HA_USES_PARSER (1 << 14)
528/** Key uses KEY_BLOCK_SIZE option. */
529#define HA_USES_BLOCK_SIZE (1 << 15)
530/**
531 Key contains partial segments.
532
533 @note This flag is internal to SQL-layer by design. It is not supposed to
534 be used to storage engines. It is intended to pass information into
535 internal static sort_keys(KEY *, KEY *) function.
536
537 This flag can be calculated -- it's based on key lengths comparison.
538*/
539#define HA_KEY_HAS_PART_KEY_SEG (1 << 16)
540/**
541 Key was renamed (or is result of renaming a key).
542
543 This is another flag internal to SQL-layer.
544 Used by in-place ALTER TABLE implementation.
545
546 @note This flag can be set for keys which have other changes than
547 simple renaming as well. So from the point of view of storage
548 engine such key might have to be dropped and re-created with
549 new definition.
550*/
551#define HA_KEY_RENAMED (1 << 17)
552/** Set if a key is on any virtual generated columns */
553#define HA_VIRTUAL_GEN_KEY (1 << 18)
554/** Multi-valued key */
555#define HA_MULTI_VALUED_KEY (1 << 19)
556
557constexpr const ulong HA_INDEX_USES_ENGINE_ATTRIBUTE{1UL << 20};
558constexpr const ulong HA_INDEX_USES_SECONDARY_ENGINE_ATTRIBUTE{1UL << 21};
559
560/* These flags can be added to key-seg-flag */
561
562#define HA_SPACE_PACK 1 /* Pack space in key-seg */
563#define HA_PART_KEY_SEG 4 /* Used by MySQL for part-key-cols */
564#define HA_VAR_LENGTH_PART 8
565#define HA_NULL_PART 16
566#define HA_BLOB_PART 32
567#define HA_SWAP_KEY 64
568#define HA_REVERSE_SORT 128 /* Sort key in reverse order */
569#define HA_NO_SORT 256 /* do not bother sorting on this keyseg */
570/*
571 End space in unique/varchar are considered equal. (Like 'a' and 'a ')
572 Only needed for internal temporary tables.
573*/
574#define HA_END_SPACE_ARE_EQUAL 512
575#define HA_BIT_PART 1024
576
577/*
578 Flags for HA_CREATE_INFO::table_options and TABLE_SHARE::db_create_options
579 TABLE_SHARE::db_options_in_use bitmaps.
580
581 @note These bitmaps are used for storing information about some table
582 option values/attributes.
583 @note HA_CREATE_INFO::table_options and TABLE_SHARE::db_create_options
584 are basically the same bitmap at the time of table creation and
585 at the time of table opening/usage correspondingly.
586 @note TABLE_SHARE::db_options_in_use is normally copy of db_create_options
587 but can be overridden by SE. E.g. MyISAM does this at handler::open()
588 and handler::info() time.
589
590 Also used for similar bitmaps in MyISAM (MYISAM_SHARE::options,
591 MI_ISAMINFO::options).
592*/
593
594/**
595 Indicates that storage engine needs to use packed row format.
596 Set for tables with ROW_FORMAT=DYNAMIC clause, for tables with BLOB fields,
597 and for tables with VARCHAR columns without ROW_FORMAT=FIXED.
598
599 This flag is respected by MyISAM only (it might also decide to use this
600 optimization for its own reasons). InnoDB relies on HA_CREATE_INFO::row_type
601 directly instead.
602*/
603#define HA_OPTION_PACK_RECORD 1
604/**
605 PACK_KEYS=1 option was specified.
606
607 PACK_KEYS=# option specifies whether key packing - optimization supported
608 by MyISAM, should be used.
609 * PACK_KEYS=1 means all keys should be packed,
610 * PACK_KEYS=0 (denoted by @sa HA_OPTION_NO_PACK_KEYS flag) means that key
611 packing should not be used at all.
612 * Not using this option or using PACK_KEYS=DEFAULT clause (denoted by
613 absence of both HA_OPTION_PACK_KEYS and HA_OPTION_NO_PACK_KEYS flags)
614 means that key packing will be used for long string columns.
615*/
616#define HA_OPTION_PACK_KEYS 2
617/**
618 Flag indicating that table is compressed. Used by MyISAM storage engine to
619 tell SQL-layer that tables is compressed. Not set or stored by SQL-layer,
620
621 MyISAM doesn't respect ROW_FORMAT=COMPRESSED clause and doesn't allow direct
622 creation of compressed tables. Existing tables can be compressed by external
623 tool. This tool marks such tables with HA_OPTION_COMPRESS_RECORD flag in
624 MYISAM_SHARE::options, MI_ISAMINFO::options. Then storage engine sets this
625 flag in TABLE_SHARE::db_options_in_use to let SQL-layer know about the fact.
626 It is never set in HA_CREATE_INFO::table_options or
627 TABLE_SHARE::db_create_options.
628*/
629#define HA_OPTION_COMPRESS_RECORD 4
630/**
631 Unused. Formerly HA_OPTION_LONG_BLOB_PTR - new ISAM format/portable
632 BLOB pointers.
633*/
634#define HA_OPTION_UNUSED1 8
635/**
636 Storage engine (MyISAM) internal flag for marking temporary tables.
637
638 Used in MYISAM_SHARE::options, MI_ISAMINFO::options, not used by SQL-layer,
639 in HA_CREATE_INFO::table_options or TABLE_SHARE::db_create_options.
640*/
641#define HA_OPTION_TMP_TABLE 16
642/**
643 CHECKSUM=1 option was specified.
644
645 This option enables live checksumming for MyISAM tables. Not used by InnoDB.
646 @sa HA_OPTION_NO_CHECKSUM.
647*/
648#define HA_OPTION_CHECKSUM 32
649/**
650 DELAY_KEY_WRITE=1 option was specified. This option enables MyISAM
651 optimization which postpones key updates until table is closed/expelled from
652 the table cache.
653
654 @sa HA_OPTION_NO_DELAY_KEY_WRITE.
655*/
656#define HA_OPTION_DELAY_KEY_WRITE 64
657/**
658 PACK_KEYS=0 option was specified.
659
660 @sa HA_OPTION_PACK_KEYS for further description.
661 @note Unlike HA_OPTION_PACK_KEYS this flag is SQL-layer only.
662*/
663#define HA_OPTION_NO_PACK_KEYS 128
664/**
665 Flag specific to table creation and HA_CREATE_INFO::table_options.
666 Indicates that storage engine instead of creating new table, needs
667 to discover existing one (which metadata was discovered from SE
668 earlier).
669 Not used in TABLE_SHARE::db_create_options/db_options_in_use.
670*/
671#define HA_OPTION_CREATE_FROM_ENGINE 256
672/**
673 Storage engine (MyISAM) internal flag for marking tables which
674 rely on SQL-layer because they have keys using fulltext parser plugin.
675
676 Used in MYISAM_SHARE::options, MI_ISAMINFO::options, not used by SQL-layer,
677 in HA_CREATE_INFO::table_options or TABLE_SHARE::db_create_options.
678*/
679#define HA_OPTION_RELIES_ON_SQL_LAYER 512
680/** Unused. Formerly HA_OPTION_NULL_FIELDS - reserved for Maria SE. */
681#define HA_OPTION_UNUSED2 1024
682/** Unused. Formerly HA_OPTION_PAGE_CHECKSUM - reserved for Maria SE. */
683#define HA_OPTION_UNUSED3 2048
684/** STATS_PERSISTENT=1 has been specified in the SQL command (either CREATE
685or ALTER TABLE). Table and index statistics that are collected by the
686storage engine and used by the optimizer for query optimization will be
687stored on disk and will not change after a server restart. */
688#define HA_OPTION_STATS_PERSISTENT 4096
689/** STATS_PERSISTENT=0 has been specified in CREATE/ALTER TABLE. Statistics
690for the table will be wiped away on server shutdown and new ones recalculated
691after the server is started again. If none of HA_OPTION_STATS_PERSISTENT or
692HA_OPTION_NO_STATS_PERSISTENT is set, this means that the setting is not
693explicitly set at table level and the corresponding table will use whatever
694is the global server default. */
695#define HA_OPTION_NO_STATS_PERSISTENT 8192
696/**
697 MyISAM internal flag used by myisamchk external tool.
698
699 Not used by SQL-layer/in HA_CREATE_INFO::table_options and
700 TABLE_SHARE::db_create_options.
701*/
702#define HA_OPTION_TEMP_COMPRESS_RECORD 16384
703/**
704 MyISAM internal flag which marks table as read-only.
705 Set by myisampack external tool.
706
707 Not used by SQL-layer/in HA_CREATE_INFO::table_options and
708 TABLE_SHARE::db_create_options.
709*/
710#define HA_OPTION_READ_ONLY_DATA 32768
711/**
712 CHECKSUM=0 option was specified. Only used by SQL-layer, in
713 HA_CREATE_INFO::table_options. Not persisted in data-dictionary.
714*/
715#define HA_OPTION_NO_CHECKSUM (1L << 17)
716/**
717 DELAY_KEY_WRITE=0 option was specified. Only used by SQL-layer, in
718 HA_CREATE_INFO::table_options. Not persisted in data-dictionary.
719*/
720#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
721
722/* Bits in flag to create() */
723
724#define HA_DONT_TOUCH_DATA 1 /* Don't empty datafile (isamchk) */
725#define HA_PACK_RECORD 2 /* Request packed record format */
726#define HA_CREATE_TMP_TABLE 4
727#define HA_CREATE_CHECKSUM 8
728#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */
729#define HA_CREATE_PAGE_CHECKSUM 32
730#define HA_CREATE_DELAY_KEY_WRITE 64
731#define HA_CREATE_RELIES_ON_SQL_LAYER 128
732#define HA_CREATE_INTERNAL_TABLE 256
733
734/*
735 The following flags (OR-ed) are passed to handler::info() method.
736 The method copies misc handler information out of the storage engine
737 to data structures accessible from MySQL
738
739 Same flags are also passed down to mi_status, myrg_status, etc.
740*/
741
742/* this one is not used */
743#define HA_STATUS_POS 1
744/*
745 assuming the table keeps shared actual copy of the 'info' and
746 local, possibly outdated copy, the following flag means that
747 it should not try to get the actual data (locking the shared structure)
748 slightly outdated version will suffice
749*/
750#define HA_STATUS_NO_LOCK 2
751/* update the time of the last modification (in handler::update_time) */
752#define HA_STATUS_TIME 4
753/*
754 Recalculate loads of constant variables. MyISAM also sets things
755 directly on the table share object.
756
757 Check whether this should be fixed since handlers should not
758 change things directly on the table object.
759
760 Monty comment: This should NOT be changed! It's the handlers
761 responsibility to correct table->s->keys_xxxx information if keys
762 have been disabled.
763
764 The most important parameters set here is records per key on
765 all indexes. block_size and primar key ref_length.
766
767 For each index there is an array of rec_per_key.
768 As an example if we have an index with three attributes a,b and c
769 we will have an array of 3 rec_per_key.
770 rec_per_key[0] is an estimate of number of records divided by
771 number of unique values of the field a.
772 rec_per_key[1] is an estimate of the number of records divided
773 by the number of unique combinations of the fields a and b.
774 rec_per_key[2] is an estimate of the number of records divided
775 by the number of unique combinations of the fields a,b and c.
776
777 Many handlers only set the value of rec_per_key when all fields
778 are bound (rec_per_key[2] in the example above).
779
780 If the handler doesn't support statistics, it should set all of the
781 above to 0.
782
783 update the 'constant' part of the info:
784 handler::max_data_file_length, max_index_file_length, create_time
785 sortkey, ref_length, block_size, data_file_name, index_file_name.
786 handler::table->s->keys_in_use, keys_for_keyread, rec_per_key
787*/
788#define HA_STATUS_CONST 8
789/*
790 update the 'variable' part of the info:
791 handler::records, deleted, data_file_length, index_file_length,
792 check_time, mean_rec_length
793*/
794#define HA_STATUS_VARIABLE 16
795/*
796 This flag is used to get index number of the unique index that
797 reported duplicate key.
798 update handler::errkey and handler::dupp_ref
799 see handler::get_dup_key()
800*/
801#define HA_STATUS_ERRKEY 32
802/*
803 update handler::auto_increment_value
804*/
805#define HA_STATUS_AUTO 64
806/*
807 Get also delete_length when HA_STATUS_VARIABLE is called. It's ok to set it
808 also when only HA_STATUS_VARIABLE but it won't be used.
809*/
810#define HA_STATUS_VARIABLE_EXTRA 128
811
812/*
813 Errorcodes given by handler functions
814
815 Do not add error numbers before HA_ERR_FIRST.
816 If necessary to add lower numbers, change HA_ERR_FIRST accordingly.
817*/
818/** Copy of first error nr.*/
819#define HA_ERR_FIRST 120
820/** Didn't find key on read or update */
821#define HA_ERR_KEY_NOT_FOUND 120
822/** Duplicate key on write */
823#define HA_ERR_FOUND_DUPP_KEY 121
824/** Internal error */
825#define HA_ERR_INTERNAL_ERROR 122
826/** Uppdate with is recoverable */
827#define HA_ERR_RECORD_CHANGED 123
828/** Wrong index given to function */
829#define HA_ERR_WRONG_INDEX 124
830/** Transaction has been rolled back */
831#define HA_ERR_ROLLED_BACK 125
832/** Indexfile is crashed */
833#define HA_ERR_CRASHED 126
834/** Record-file is crashed */
835#define HA_ERR_WRONG_IN_RECORD 127
836/** Record-file is crashed */
837#define HA_ERR_OUT_OF_MEM 128
838/** not a MYI file - no signature */
839#define HA_ERR_NOT_A_TABLE 130
840/** Command not supported */
841#define HA_ERR_WRONG_COMMAND 131
842/** old database file */
843#define HA_ERR_OLD_FILE 132
844/** No record read in update() */
845#define HA_ERR_NO_ACTIVE_RECORD 133
846/** A record is not there */
847#define HA_ERR_RECORD_DELETED 134
848/** No more room in file */
849#define HA_ERR_RECORD_FILE_FULL 135
850/** No more room in file */
851#define HA_ERR_INDEX_FILE_FULL 136
852/** end in next/prev/first/last */
853#define HA_ERR_END_OF_FILE 137
854/** unsupported extension used */
855#define HA_ERR_UNSUPPORTED 138
856/** Too big row */
857#define HA_ERR_TOO_BIG_ROW 139
858/** Wrong create option */
859#define HA_WRONG_CREATE_OPTION 140
860/** Duplicate unique on write */
861#define HA_ERR_FOUND_DUPP_UNIQUE 141
862/** Can't open charset */
863#define HA_ERR_UNKNOWN_CHARSET 142
864/** conflicting tables in MERGE */
865#define HA_ERR_WRONG_MRG_TABLE_DEF 143
866/** Last (automatic?) repair failed */
867#define HA_ERR_CRASHED_ON_REPAIR 144
868/** Table must be repaired */
869#define HA_ERR_CRASHED_ON_USAGE 145
870#define HA_ERR_LOCK_WAIT_TIMEOUT 146
871#define HA_ERR_LOCK_TABLE_FULL 147
872/** Updates not allowed */
873#define HA_ERR_READ_ONLY_TRANSACTION 148
874#define HA_ERR_LOCK_DEADLOCK 149
875/** Cannot add a foreign key constr. */
876#define HA_ERR_CANNOT_ADD_FOREIGN 150
877/** Cannot add a child row */
878#define HA_ERR_NO_REFERENCED_ROW 151
879/** Cannot delete a parent row */
880#define HA_ERR_ROW_IS_REFERENCED 152
881/** No savepoint with that name */
882#define HA_ERR_NO_SAVEPOINT 153
883/** Non unique key block size */
884#define HA_ERR_NON_UNIQUE_BLOCK_SIZE 154
885/** The table does not exist in engine */
886#define HA_ERR_NO_SUCH_TABLE 155
887/** The table existed in storage engine */
888#define HA_ERR_TABLE_EXIST 156
889/** Could not connect to storage engine */
890#define HA_ERR_NO_CONNECTION 157
891/** NULLs are not supported in spatial index */
892#define HA_ERR_NULL_IN_SPATIAL 158
893/** The table changed in storage engine */
894#define HA_ERR_TABLE_DEF_CHANGED 159
895/** There's no partition in table for given value */
896#define HA_ERR_NO_PARTITION_FOUND 160
897/** Row-based binlogging of row failed */
898#define HA_ERR_RBR_LOGGING_FAILED 161
899/** Index needed in foreign key constraint */
900#define HA_ERR_DROP_INDEX_FK 162
901/** Upholding foreign key constraints would lead to a duplicate key error
902in some other table. */
903#define HA_ERR_FOREIGN_DUPLICATE_KEY 163
904/** The table changed in storage engine */
905#define HA_ERR_TABLE_NEEDS_UPGRADE 164
906/** The table is not writable */
907#define HA_ERR_TABLE_READONLY 165
908/** Failed to get next autoinc value */
909#define HA_ERR_AUTOINC_READ_FAILED 166
910/** Failed to set row autoinc value */
911#define HA_ERR_AUTOINC_ERANGE 167
912/** Generic error */
913#define HA_ERR_GENERIC 168
914/** row not actually updated: new values same as the old values */
915#define HA_ERR_RECORD_IS_THE_SAME 169
916/** It is not possible to log this statement */
917#define HA_ERR_LOGGING_IMPOSSIBLE 170
918/** The event was corrupt, leading to illegal data being read */
919#define HA_ERR_CORRUPT_EVENT 171
920/** New file format */
921#define HA_ERR_NEW_FILE 172
922/** The event could not be processed no other handler error happened */
923#define HA_ERR_ROWS_EVENT_APPLY 173
924/** Error during initialization */
925#define HA_ERR_INITIALIZATION 174
926/** File too short */
927#define HA_ERR_FILE_TOO_SHORT 175
928/** Wrong CRC on page */
929#define HA_ERR_WRONG_CRC 176
930/** Too many active concurrent transactions */
931#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177
932/** There's no explicitly listed partition in table for the given value */
933#define HA_ERR_NOT_IN_LOCK_PARTITIONS 178
934/** Index column length exceeds limit */
935#define HA_ERR_INDEX_COL_TOO_LONG 179
936/** InnoDB index corrupted */
937#define HA_ERR_INDEX_CORRUPT 180
938/** Undo log record too big */
939#define HA_ERR_UNDO_REC_TOO_BIG 181
940/** Invalid InnoDB Doc ID */
941#define HA_FTS_INVALID_DOCID 182
942/** Table being used in foreign key check */
943#define HA_ERR_TABLE_IN_FK_CHECK 183
944/** The tablespace existed in storage engine */
945#define HA_ERR_TABLESPACE_EXISTS 184
946/** Table has too many columns */
947#define HA_ERR_TOO_MANY_FIELDS 185
948/** Row in wrong partition */
949#define HA_ERR_ROW_IN_WRONG_PARTITION 186
950/** InnoDB is in read only mode. */
951#define HA_ERR_INNODB_READ_ONLY 187
952/** FTS query exceeds result cache limit */
953#define HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT 188
954/** Temporary file write failure */
955#define HA_ERR_TEMP_FILE_WRITE_FAILURE 189
956/** Innodb is in force recovery mode */
957#define HA_ERR_INNODB_FORCED_RECOVERY 190
958/** Too many words in a phrase */
959#define HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE 191
960/** FK cascade depth exceeded */
961#define HA_ERR_FK_DEPTH_EXCEEDED 192
962/** Option Missing during Create */
963#define HA_MISSING_CREATE_OPTION 193
964/** Out of memory in storage engine */
965#define HA_ERR_SE_OUT_OF_MEMORY 194
966/** Table/Clustered index is corrupted. */
967#define HA_ERR_TABLE_CORRUPT 195
968/** The query was interrupted */
969#define HA_ERR_QUERY_INTERRUPTED 196
970/** Missing Tablespace */
971#define HA_ERR_TABLESPACE_MISSING 197
972/** Tablespace is not empty */
973#define HA_ERR_TABLESPACE_IS_NOT_EMPTY 198
974/** Invalid Filename */
975#define HA_ERR_WRONG_FILE_NAME 199
976/** Operation is not allowed */
977#define HA_ERR_NOT_ALLOWED_COMMAND 200
978/** Compute generated column value failed */
979#define HA_ERR_COMPUTE_FAILED 201
980/** Table's row format has changed in the storage engine.
981Information in the data-dictionary needs to be updated. */
982#define HA_ERR_ROW_FORMAT_CHANGED 202
983/** Don't wait for record lock */
984#define HA_ERR_NO_WAIT_LOCK 203
985/** No more room in disk */
986#define HA_ERR_DISK_FULL_NOWAIT 204
987/** No session temporary space available */
988#define HA_ERR_NO_SESSION_TEMP 205
989/** Wrong or Invalid table name */
990#define HA_ERR_WRONG_TABLE_NAME 206
991/** Path is too long for the OS */
992#define HA_ERR_TOO_LONG_PATH 207
993/** Histogram sampling initialization failed */
994#define HA_ERR_SAMPLING_INIT_FAILED 208
995/** Too many sub-expression in search string */
996#define HA_ERR_FTS_TOO_MANY_NESTED_EXP 209
997/** Copy of last error number */
998#define HA_ERR_LAST 209
999
1000/* Number of different errors */
1001#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
1002
1003/* Other constants */
1004
1005#define HA_NAMELEN 64 /* Max length of saved filename */
1006#define NO_SUCH_KEY (~(uint)0) /* used as a key no. */
1007
1008typedef ulong key_part_map;
1009#define HA_WHOLE_KEY (~(key_part_map)0)
1010
1011/* Intern constants in databases */
1012
1013/* bits in _search */
1014#define SEARCH_FIND 1
1015#define SEARCH_NO_FIND 2
1016#define SEARCH_SAME 4
1017#define SEARCH_BIGGER 8
1018#define SEARCH_SMALLER 16
1019#define SEARCH_SAVE_BUFF 32
1020#define SEARCH_UPDATE 64
1021#define SEARCH_PREFIX 128
1022#define SEARCH_LAST 256
1023#define MBR_CONTAIN 512
1024#define MBR_INTERSECT 1024
1025#define MBR_WITHIN 2048
1026#define MBR_DISJOINT 4096
1027#define MBR_EQUAL 8192
1028#define MBR_DATA 16384
1029#define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */
1030#define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */
1031
1032/* bits in opt_flag */
1033#define QUICK_USED 1
1034#define READ_CACHE_USED 2
1035#define READ_CHECK_USED 4
1036#define KEY_READ_USED 8
1037#define WRITE_CACHE_USED 16
1038#define OPT_NO_ROWS 32
1039
1040/* bits in update */
1041#define HA_STATE_CHANGED 1 /* Database has changed */
1042#define HA_STATE_AKTIV 2 /* Has a current record */
1043#define HA_STATE_WRITTEN 4 /* Record is written */
1044#define HA_STATE_DELETED 8
1045#define HA_STATE_NEXT_FOUND 16 /* Next found record (record before) */
1046#define HA_STATE_PREV_FOUND 32 /* Prev found record (record after) */
1047#define HA_STATE_NO_KEY 64 /* Last read didn't find record */
1048#define HA_STATE_KEY_CHANGED 128
1049#define HA_STATE_WRITE_AT_END 256 /* set in _ps_find_writepos */
1050#define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */
1051#define HA_STATE_ROW_CHANGED 1024 /* To invalidate ROW cache */
1052#define HA_STATE_EXTEND_BLOCK 2048
1053
1054/* myisampack expects no more than 32 field types. */
1069
1076
1077/* For key ranges */
1078
1080 NO_MIN_RANGE = 1 << 0, ///< from -inf
1081 NO_MAX_RANGE = 1 << 1, ///< to +inf
1082 /* X < key, i.e. not including the left endpoint */
1083 NEAR_MIN = 1 << 2,
1084 /* X > key, i.e. not including the right endpoint */
1085 NEAR_MAX = 1 << 3,
1086 /*
1087 This flag means that index is a unique index, and the interval is
1088 equivalent to "AND(keypart_i = const_i)", where all of const_i are
1089 not NULLs.
1090 */
1092 /*
1093 This flag means that the interval is equivalent to
1094 "AND(keypart_i = const_i)", where not all key parts may be used
1095 but all of const_i are not NULLs.
1096 */
1097 EQ_RANGE = 1 << 5,
1098 /*
1099 This flag has the same meaning as UNIQUE_RANGE, except that for at
1100 least one keypart the condition is "keypart IS NULL".
1101 */
1102 NULL_RANGE = 1 << 6,
1103 /**
1104 This flag means that the index is an rtree index, and the interval is
1105 specified using HA_READ_MBR_XXX defined in enum ha_rkey_function.
1106 */
1107 GEOM_FLAG = 1 << 7,
1108 /* Deprecated, currently used only by NDB at row retrieval */
1109 // Update: Seems to be unused, even by NDB
1110 SKIP_RANGE = 1 << 8,
1111 /*
1112 Used to indicate that index dives can be skipped. This can happen when:
1113 a) Query satisfies JOIN_TAB::check_skip_records_in_range_qualification. OR
1114 b) Used together with EQ_RANGE to indicate that index statistics should be
1115 used instead of sampling the index.
1116 */
1118 /*
1119 Keypart is reverse-ordered (DESC) and ranges needs to be scanned
1120 backward. @see quick_range_seq_init, get_quick_keys.
1121 */
1122 DESC_FLAG = 1 << 10,
1123};
1124
1126 const uchar *key;
1130};
1131
1135 char *ptr; /* Free to use by caller (ptr to row etc) */
1136 uint range_flag; /* key range flags see above */
1137};
1138
1139/* For number of records */
1140#define rows2double(A) ulonglong2double(A)
1142
1143#define HA_POS_ERROR (~(ha_rows)0)
1144#define HA_OFFSET_ERROR (~(my_off_t)0)
1145
1146#define MAX_FILE_SIZE LLONG_MAX
1147
1148#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 : 2)
1149
1150#endif /* _my_base_h */
ha_base_keytype
Definition: my_base.h:440
@ HA_KEYTYPE_VARBINARY2
Definition: my_base.h:461
@ HA_KEYTYPE_BINARY
Definition: my_base.h:443
@ HA_KEYTYPE_USHORT_INT
Definition: my_base.h:449
@ HA_KEYTYPE_ULONGLONG
Definition: my_base.h:452
@ HA_KEYTYPE_UINT24
Definition: my_base.h:454
@ HA_KEYTYPE_VARTEXT2
Definition: my_base.h:460
@ HA_KEYTYPE_FLOAT
Definition: my_base.h:446
@ HA_KEYTYPE_BIT
Definition: my_base.h:462
@ HA_KEYTYPE_END
Definition: my_base.h:441
@ HA_KEYTYPE_ULONG_INT
Definition: my_base.h:450
@ HA_KEYTYPE_SHORT_INT
Definition: my_base.h:444
@ HA_KEYTYPE_NUM
Definition: my_base.h:448
@ HA_KEYTYPE_DOUBLE
Definition: my_base.h:447
@ HA_KEYTYPE_LONG_INT
Definition: my_base.h:445
@ HA_KEYTYPE_INT8
Definition: my_base.h:455
@ HA_KEYTYPE_INT24
Definition: my_base.h:453
@ HA_KEYTYPE_VARTEXT1
Definition: my_base.h:457
@ HA_KEYTYPE_VARBINARY1
Definition: my_base.h:458
@ HA_KEYTYPE_TEXT
Definition: my_base.h:442
@ HA_KEYTYPE_LONGLONG
Definition: my_base.h:451
ha_panic_function
Definition: my_base.h:432
@ HA_PANIC_WRITE
Definition: my_base.h:434
@ HA_PANIC_CLOSE
Definition: my_base.h:433
@ HA_PANIC_READ
Definition: my_base.h:435
data_file_type
Definition: my_base.h:1070
@ COMPRESSED_RECORD
Definition: my_base.h:1073
@ DYNAMIC_RECORD
Definition: my_base.h:1072
@ BLOCK_RECORD
Definition: my_base.h:1074
@ STATIC_RECORD
Definition: my_base.h:1071
ha_key_alg
Definition: my_base.h:98
@ HA_KEY_ALG_RTREE
Definition: my_base.h:109
@ HA_KEY_ALG_HASH
Definition: my_base.h:110
@ HA_KEY_ALG_SE_SPECIFIC
Used for cases when key algorithm which is supported by SE can't be described by one of other classes...
Definition: my_base.h:107
@ HA_KEY_ALG_BTREE
Definition: my_base.h:108
@ HA_KEY_ALG_FULLTEXT
Definition: my_base.h:111
ha_rkey_function
Definition: my_base.h:78
@ HA_READ_MBR_EQUAL
Definition: my_base.h:91
@ HA_READ_KEY_OR_PREV
Definition: my_base.h:81
@ HA_READ_PREFIX_LAST
Definition: my_base.h:85
@ HA_READ_NEAREST_NEIGHBOR
Definition: my_base.h:92
@ HA_READ_PREFIX_LAST_OR_PREV
Definition: my_base.h:86
@ HA_READ_KEY_EXACT
Definition: my_base.h:79
@ HA_READ_AFTER_KEY
Definition: my_base.h:82
@ HA_READ_MBR_DISJOINT
Definition: my_base.h:90
@ HA_READ_INVALID
Definition: my_base.h:93
@ HA_READ_MBR_INTERSECT
Definition: my_base.h:88
@ HA_READ_BEFORE_KEY
Definition: my_base.h:83
@ HA_READ_MBR_CONTAIN
Definition: my_base.h:87
@ HA_READ_MBR_WITHIN
Definition: my_base.h:89
@ HA_READ_KEY_OR_NEXT
Definition: my_base.h:80
@ HA_READ_PREFIX
Definition: my_base.h:84
key_range_flags
Definition: my_base.h:1079
@ UNIQUE_RANGE
Definition: my_base.h:1091
@ SKIP_RANGE
Definition: my_base.h:1110
@ NEAR_MIN
Definition: my_base.h:1083
@ DESC_FLAG
Definition: my_base.h:1122
@ NO_MIN_RANGE
from -inf
Definition: my_base.h:1080
@ NO_MAX_RANGE
to +inf
Definition: my_base.h:1081
@ EQ_RANGE
Definition: my_base.h:1097
@ SKIP_RECORDS_IN_RANGE
Definition: my_base.h:1117
@ NEAR_MAX
Definition: my_base.h:1085
@ NULL_RANGE
Definition: my_base.h:1102
@ GEOM_FLAG
This flag means that the index is an rtree index, and the interval is specified using HA_READ_MBR_XXX...
Definition: my_base.h:1107
ulong key_part_map
Definition: my_base.h:1008
my_off_t ha_rows
Definition: my_base.h:1141
ha_extra_function
Definition: my_base.h:185
@ HA_EXTRA_NO_USER_CHANGE
Definition: my_base.h:246
@ HA_EXTRA_ENABLE_UNIQUE_RECORD_FILTER
Definition: my_base.h:422
@ HA_EXTRA_NO_KEYREAD
Definition: my_base.h:241
@ HA_EXTRA_KEYREAD_CHANGE_POS
Definition: my_base.h:261
@ HA_EXTRA_ADD_CHILDREN_LIST
Definition: my_base.h:398
@ HA_EXTRA_REMEMBER_POS
Definition: my_base.h:263
@ HA_EXTRA_FORCE_REOPEN
Definition: my_base.h:269
@ HA_EXTRA_DELETE_CANNOT_BATCH
Definition: my_base.h:381
@ HA_EXTRA_NORMAL
Definition: my_base.h:194
@ HA_EXTRA_IS_ATTACHED_CHILDREN
Definition: my_base.h:400
@ HA_EXTRA_NO_AUTOINC_LOCKING
Definition: my_base.h:417
@ HA_EXTRA_WAIT_LOCK
Definition: my_base.h:254
@ HA_EXTRA_WRITE_CAN_REPLACE
Definition: my_base.h:373
@ HA_EXTRA_FLUSH
Definition: my_base.h:275
@ HA_EXTRA_IGNORE_NO_KEY
Definition: my_base.h:359
@ HA_EXTRA_NO_READ_LOCKING
Skip acquiring locks when reading from ACL tables or views on DD tables in order to make such reads n...
Definition: my_base.h:411
@ HA_EXTRA_SECONDARY_SORT_ROWID
Do secondary sort by handler::ref (rowid) after key sort.
Definition: my_base.h:408
@ HA_EXTRA_PREPARE_FOR_UPDATE
Definition: my_base.h:338
@ HA_EXTRA_DETACH_CHILDREN
Definition: my_base.h:401
@ HA_EXTRA_CHANGE_KEY_TO_DUP
Definition: my_base.h:344
@ HA_EXTRA_READCHECK
Definition: my_base.h:226
@ HA_EXTRA_UPDATE_CANNOT_BATCH
Definition: my_base.h:382
@ HA_EXTRA_NO_READCHECK
Definition: my_base.h:225
@ HA_EXTRA_DISABLE_UNIQUE_RECORD_FILTER
Definition: my_base.h:424
@ HA_EXTRA_NO_IGNORE_DUP_KEY
Definition: my_base.h:324
@ HA_EXTRA_CHANGE_KEY_TO_UNIQUE
Definition: my_base.h:343
@ HA_EXTRA_PREPARE_FOR_DROP
Definition: my_base.h:330
@ HA_EXTRA_MARK_AS_LOG_TABLE
Definition: my_base.h:365
@ HA_EXTRA_NO_IGNORE_NO_KEY
Definition: my_base.h:360
@ HA_EXTRA_PREPARE_FOR_RENAME
Definition: my_base.h:394
@ HA_EXTRA_INSERT_WITH_UPDATE
Definition: my_base.h:387
@ HA_EXTRA_KEYREAD
Definition: my_base.h:240
@ HA_EXTRA_KEYREAD_PRESERVE_FIELDS
Definition: my_base.h:351
@ HA_EXTRA_ATTACH_CHILDREN
Definition: my_base.h:399
@ HA_EXTRA_EXPORT
Definition: my_base.h:406
@ HA_EXTRA_NO_KEYS
Definition: my_base.h:260
@ HA_EXTRA_NO_WAIT_LOCK
Definition: my_base.h:255
@ HA_EXTRA_QUICK
Definition: my_base.h:207
@ HA_EXTRA_RESTORE_POS
Definition: my_base.h:264
@ HA_EXTRA_PRELOAD_BUFFER_SIZE
Definition: my_base.h:339
@ HA_EXTRA_NO_ROWS
Definition: my_base.h:280
@ HA_EXTRA_RESET_STATE
Definition: my_base.h:315
@ HA_EXTRA_WRITE_CANNOT_REPLACE
Definition: my_base.h:374
@ HA_EXTRA_BEGIN_ALTER_COPY
Definition: my_base.h:413
@ HA_EXTRA_IGNORE_DUP_KEY
Definition: my_base.h:323
@ HA_EXTRA_NOT_USED
Definition: my_base.h:208
@ HA_EXTRA_END_ALTER_COPY
Definition: my_base.h:415
constexpr const ulong HA_INDEX_USES_SECONDARY_ENGINE_ATTRIBUTE
Definition: my_base.h:558
ha_storage_media
Definition: my_base.h:116
@ HA_SM_MEMORY
Definition: my_base.h:119
@ HA_SM_DISK
Definition: my_base.h:118
@ HA_SM_DEFAULT
Definition: my_base.h:117
en_fieldtype
Definition: my_base.h:1055
@ FIELD_CONSTANT
Definition: my_base.h:1062
@ FIELD_VARCHAR
Definition: my_base.h:1065
@ FIELD_BLOB
Definition: my_base.h:1061
@ FIELD_enum_val_count
Definition: my_base.h:1067
@ FIELD_ZERO
Definition: my_base.h:1064
@ FIELD_SKIP_PRESPACE
Definition: my_base.h:1059
@ FIELD_SKIP_ENDSPACE
Definition: my_base.h:1058
@ FIELD_CHECK
Definition: my_base.h:1066
@ FIELD_SKIP_ZERO
Definition: my_base.h:1060
@ FIELD_INTERVALL
Definition: my_base.h:1063
@ FIELD_LAST
Definition: my_base.h:1056
@ FIELD_NORMAL
Definition: my_base.h:1057
constexpr const ulong HA_INDEX_USES_ENGINE_ATTRIBUTE
Definition: my_base.h:557
Utility functions for converting between ulonglong and double.
Some integer typedefs for easier portability.
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
Some common macros.
Definition: my_base.h:1132
uint range_flag
Definition: my_base.h:1136
key_range end_key
Definition: my_base.h:1134
key_range start_key
Definition: my_base.h:1133
char * ptr
Definition: my_base.h:1135
Definition: my_base.h:1125
uint length
Definition: my_base.h:1127
enum ha_rkey_function flag
Definition: my_base.h:1129
key_part_map keypart_map
Definition: my_base.h:1128
const uchar * key
Definition: my_base.h:1126