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