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