MySQL  8.0.19
Source Code Documentation
myisamdef.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License, version 2.0,
6  as published by the Free Software Foundation.
7 
8  This program is also distributed with certain software (including
9  but not limited to OpenSSL) that is licensed under separate terms,
10  as designated in a particular file or component or in included license
11  documentation. The authors of MySQL hereby grant you an additional
12  permission to link the program and your derivative works with the
13  separately licensed software that they have included with MySQL.
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 /* This file is included by all internal myisam files */
25 
26 /**
27  @file storage/myisam/myisamdef.h
28 */
29 
30 #ifndef STORAGE_MYISAM_MYISAMDEF_INCLUDED
31 #define STORAGE_MYISAM_MYISAMDEF_INCLUDED 1
32 
33 #include "my_alloc.h"
34 #include "my_icp.h"
35 #include "my_pointer_arithmetic.h"
36 #include "myisam.h" /* Structs & some defines */
37 #include "myisampack.h" /* packing of keys */
38 #include "mysql/psi/mysql_file.h"
39 #include "mysql/psi/mysql_rwlock.h"
40 #include "mysql/psi/mysql_thread.h"
41 #include "thr_lock.h"
42 
43 struct HA_KEYSEG;
44 struct KEY_CACHE;
45 struct MI_INFO;
47 struct TREE;
49 
50 /* undef map from my_nosys; We need test-if-disk full */
51 #if defined(my_write)
52 #undef my_write
53 #endif
54 
56  ha_rows records; /* Rows in table */
57  ha_rows del; /* Removed rows */
58  my_off_t empty; /* lost space in datafile */
59  my_off_t key_empty; /* lost space in indexfile */
63  bool uncacheable; /* Active concurrent insert */
64 };
65 
66 struct MI_STATE_INFO {
67  struct { /* Fileheader */
74  uchar key_parts[2]; /* Key parts */
75  uchar unique_key_parts[2]; /* Key parts + unique parts */
76  uchar keys; /* number of keys in file */
77  uchar uniques; /* number of UNIQUE definitions */
78  uchar language; /* Language for indexes */
79  uchar max_block_size_index; /* max keyblock size */
81  uchar not_used; /* To align to 8 */
82  } header;
83 
85  ha_rows split; /* number of split blocks */
86  my_off_t dellink; /* Link to next removed block */
88  ulong process; /* process that updated table last */
89  ulong unique; /* Unique number for this process */
90  ulong update_count; /* Updated for each write lock */
93  my_off_t *key_root; /* Start of key trees */
94  my_off_t *key_del; /* delete links for trees */
95  my_off_t rec_per_key_rows; /* Rows when calculating rec_per_key */
96 
97  ulong sec_index_changed; /* Updated when new sec_index */
98  ulong sec_index_used; /* which extra index are in use */
99  ulonglong key_map; /* Which keys are in use */
100  ha_checksum checksum; /* Table checksum */
101  ulong version; /* timestamp of create */
102  time_t create_time; /* Time when created database */
103  time_t recover_time; /* Time for last recover */
104  time_t check_time; /* Time for last check */
105  uint sortkey; /* sorted by this key (not used) */
107  uint8 changed; /* Changed since myisamchk */
108 
109  /* the following isn't saved on disk */
110  uint state_diff_length; /* Should be 0 */
111  uint state_length; /* Length of state header in file */
113 };
114 
115 #define MI_STATE_INFO_SIZE (24 + 14 * 8 + 7 * 4 + 2 * 2 + 8)
116 #define MI_STATE_KEY_SIZE 8
117 #define MI_STATE_KEYBLOCK_SIZE 8
118 #define MI_STATE_KEYSEG_SIZE 4
119 #define MI_STATE_EXTRA_SIZE \
120  ((MI_MAX_KEY + MI_MAX_KEY_BLOCK_SIZE) * MI_STATE_KEY_SIZE + \
121  MI_MAX_KEY * MI_MAX_KEY_SEG * MI_STATE_KEYSEG_SIZE)
122 #define MI_KEYDEF_SIZE (2 + 5 * 2)
123 #define MI_UNIQUEDEF_SIZE (2 + 1 + 1)
124 #define HA_KEYSEG_SIZE (6 + 2 * 2 + 4 * 2)
125 #define MI_COLUMNDEF_SIZE (2 * 3 + 1)
126 #define MI_BASE_INFO_SIZE (5 * 8 + 8 * 4 + 4 + 4 * 2 + 16)
127 #define MI_INDEX_BLOCK_MARGIN 16 /* Safety margin for .MYI tables */
128 
129 struct MI_BASE_INFO {
130  my_off_t keystart; /* Start of keys */
134  ha_rows records, reloc; /* Create information */
135  ulong mean_row_length; /* Create information */
136  ulong reclength; /* length of unpacked record */
137  ulong pack_reclength; /* Length of full packed rec. */
139  ulong max_pack_length; /* Max possibly length of packed rec.*/
141  ulong fields, /* fields in table */
142  pack_fields; /* packed fields in table */
143  uint rec_reflength; /* = 2-8 */
144  uint key_reflength; /* = 2-8 */
145  uint keys; /* same as in state.header */
146  uint auto_key; /* Which key-1 is a auto key */
147  uint blobs; /* Number of blobs */
148  uint pack_bits; /* Length of packed bits */
149  uint max_key_block_length; /* Max block length */
150  uint max_key_length; /* Max key length */
151  /* Extra allocation when using dynamic record format */
154  /* The following are from the header */
156 };
157 
158 /* Structs used intern in database */
159 
160 struct MI_BLOB /* Info of record */
161 {
162  ulong offset; /* Offset to blob in record */
163  uint pack_length; /* Type of packed length */
164  ulong length; /* Calc:ed for each record */
165 };
166 
167 struct MI_PACK {
171 };
172 
173 #define MAX_NONMAPPED_INSERTS 1000
174 
175 struct MYISAM_SHARE { /* Shared between opens */
178  MI_KEYDEF ft2_keyinfo; /* Second-level ft-key definition */
179  MI_KEYDEF *keyinfo; /* Key definitions */
180  MI_UNIQUEDEF *uniqueinfo; /* unique definitions */
181  HA_KEYSEG *keyparts; /* key part info */
182  MI_COLUMNDEF *rec; /* Pointer to field information */
183  MI_PACK pack; /* Data about packed records */
184  MI_BLOB *blobs; /* Pointer to blobs */
185  LIST *in_use; /* List of threads using this table */
186  char *unique_file_name; /* realpath() of index file */
187  char *data_file_name, /* Resolved path names from symlinks */
189  uchar *file_map; /* mem-map of file if possible */
190  KEY_CACHE *key_cache; /* ref to the current key cache */
194  int (*write_record)(MI_INFO *, const uchar *);
195  int (*update_record)(MI_INFO *, my_off_t, const uchar *);
198  int (*compare_record)(MI_INFO *, const uchar *);
199  /* Function to use for a row checksum. */
202  my_off_t pos);
203  size_t (*file_read)(MI_INFO *, uchar *, size_t, my_off_t, myf);
204  size_t (*file_write)(MI_INFO *, const uchar *, size_t, my_off_t, myf);
205  ulong this_process; /* processid */
206  ulong last_process; /* For table-change-check */
207  ulong last_version; /* Version on start */
208  ulong options; /* Options used */
209  ulong min_pack_length; /* Theese are used by packed data */
212  uint rec_reflength; /* rec_reflength in use now */
214  uint32 ftkeys; /* Number of full-text keys + 1 */
215  File kfile; /* Shared keyfile */
216  File data_file; /* Shared data file */
217  int mode; /* mode of file on open */
218  uint reopen; /* How many times reopened */
219  uint w_locks, r_locks, tot_locks; /* Number of read/write locks */
220  uint blocksize; /* blocksize of keyfile */
223  /* Below flag is needed to make log tables work with concurrent insert */
225 
226  bool changed, /* If changed since lock */
227  global_changed, /* If changed since open */
229 
231  mysql_mutex_t intern_lock; /* Locking for use with _locking */
234  uint nonmmaped_inserts; /* counter of writing in non-mmaped
235  area */
237 };
238 
240 
241 struct MI_BIT_BUFF { /* Used for packing of record */
246 };
247 
248 typedef ICP_RESULT (*index_cond_func_t)(void *param);
249 
250 struct MI_INFO {
251  MYISAM_SHARE *s; /* Shared between open:s */
253  MI_BLOB *blobs; /* Pointer to blobs */
255  /* accumulate indexfile changes between write's */
257  DYNAMIC_ARRAY *ft1_to_ft2; /* used only in ft1->ft2 conversion */
258  MEM_ROOT ft_memroot; /* used by the parser */
259  MYSQL_FTPARSER_PARAM *ftparser_param; /* share info between init/deinit */
260  LIST in_use; /* Thread using this table */
261  char *filename; /* parameter to open filename */
262  uchar *buff, /* Temp area for key */
263  *lastkey, *lastkey2; /* Last used search key */
264 
265  /* Key used in mi_rnext_same and filled by mi_rkey. */
267  uchar *first_mbr_key; /* Searhed spatial key */
268  uchar *rec_buff; /* Tempbuff for recordpack */
269  uchar *int_keypos, /* Save position for next/previous */
270  *int_maxpos; /* -""- */
271  uint int_nod_flag; /* -""- */
274  ulong this_unique; /* uniq filenumber or thread */
275  ulong last_unique; /* last unique number */
276  ulong this_loop; /* counter for this open */
277  ulong last_loop; /* last used counter */
278  my_off_t lastpos, /* Last record position */
279  nextpos; /* Position to next record */
281  my_off_t pos; /* Intern variable */
282  my_off_t last_keypage; /* Last key page read */
283  my_off_t last_search_keypage; /* Last keypage when searching */
285  ha_checksum checksum; /* Temp storage for row checksum */
286  /* QQ: the folloing two xxx_length fields should be removed,
287  as they are not compatible with parallel repair */
288  ulong packed_length, blob_length; /* Length of found, packed record */
289  int dfile; /* The datafile */
290  uint opt_flag; /* Optim. for space/speed */
291  uint update; /* If file changed since open */
292  int lastinx; /* Last used index */
293  uint lastkey_length; /* Length of key in lastkey */
294  uint last_rkey_length; /* Last length in mi_rkey() */
295  enum ha_rkey_function last_key_func; /* CONTAIN, OVERLAP, etc */
297  uint pack_key_length; /* For MYISAMMRG */
298  uint16 last_used_keyseg; /* For MyISAMMRG */
299  int errkey; /* Got last error on this key */
300  int lock_type; /* How database was locked */
301  int tmp_lock_type; /* When locked by readinfo */
302  uint data_changed; /* Somebody has changed data */
303  uint save_update; /* When using KEY_READ */
306  IO_CACHE rec_cache; /* When cacheing records */
307  uint preload_buff_size; /* When preloading indexes */
308  myf lock_wait; /* is 0 or MY_DONT_WAIT */
309  bool was_locked; /* Was locked in panic */
310  bool append_insert_at_end; /* Set if concurrent insert */
312  bool page_changed; /* If info->buff can't be used for rnext */
313  bool buff_used; /* If info->buff has to be reread for rnext */
314  uint8 once_flags; /* For MYISAMMRG */
315 
316  /* Used in mi_rnext_same to fill rnext_same_key for the first time. */
318 
319  index_cond_func_t index_cond_func; /* Index condition function */
320  void *index_cond_func_arg; /* parameter for the func */
321 #ifdef _WIN32
322  bool owned_by_merge; /* This MyISAM table is part of a merge union */
323 #endif
325  uchar *rtree_recursion_state; /* For RTREE */
327 };
328 
329 struct BUFFPEK {
330  my_off_t file_pos; /* Where we are in the sort file */
331  uchar *base, *key; /* Key pointers */
332  ha_rows count; /* Number of rows in table */
333  ulong mem_count; /* numbers of keys in memory */
334  ulong max_keys; /* Max keys in buffert */
335 };
336 
341  MI_BIT_BUFF bit_buff; /* For parallel repair of packrec. */
342 
343  /*
344  The next two are used to collect statistics, see update_key_parts for
345  description.
346  */
350 
355  bool calc_checksum; /* calculate table checksum */
361  void *wordlist, *wordptr;
365  int (*key_cmp)(void *, uchar *, uchar *);
366  int (*key_read)(MI_SORT_PARAM *, void *);
367  int (*key_write)(MI_SORT_PARAM *, const void *);
371 };
372 
373 /* Some defines used by isam-funktions */
374 
375 #define USE_WHOLE_KEY MI_MAX_KEY_BUFF * 2 /* Use whole key in _mi_search() */
376 #define F_EXTRA_LCK -1
377 
378 /* bits in opt_flag */
379 #define MEMMAP_USED 32
380 #define REMEMBER_OLD_POS 64
381 
382 #define WRITEINFO_UPDATE_KEYFILE 1
383 #define WRITEINFO_NO_UNLOCK 2
384 
385 /* once_flags */
386 #define USE_PACKED_KEYS 1
387 #define RRND_PRESERVE_LASTINX 2
388 
389 /* bits in state.changed */
390 
391 #define STATE_CHANGED 1
392 #define STATE_CRASHED 2
393 #define STATE_CRASHED_ON_REPAIR 4
394 #define STATE_NOT_ANALYZED 8
395 #define STATE_NOT_OPTIMIZED_KEYS 16
396 #define STATE_NOT_SORTED_PAGES 32
397 
398 /* options to mi_read_cache */
399 
400 #define READING_NEXT 1
401 #define READING_HEADER 2
402 
403 #define mi_getint(x) ((uint)mi_uint2korr(x) & 32767)
404 #define mi_putint(x, y, nod) \
405  { \
406  uint16 boh = (nod ? (uint16)32768 : 0) + (uint16)(y); \
407  mi_int2store(x, boh); \
408  }
409 #define mi_test_if_nod(x) (x[0] & 128 ? info->s->base.key_reflength : 0)
410 #define mi_report_crashed(A, B) _mi_report_crashed((A), (B), __FILE__, __LINE__)
411 #define mi_mark_crashed(x) \
412  do { \
413  (x)->s->state.changed |= STATE_CRASHED; \
414  DBUG_PRINT("error", ("Marked table crashed")); \
415  mi_report_crashed((x), 0); \
416  } while (0)
417 #define mi_mark_crashed_on_repair(x) \
418  do { \
419  (x)->s->state.changed |= STATE_CRASHED | STATE_CRASHED_ON_REPAIR; \
420  (x)->update |= HA_STATE_CHANGED; \
421  DBUG_PRINT("error", ("Marked table crashed")); \
422  } while (0)
423 #define mi_is_crashed(x) ((x)->s->state.changed & STATE_CRASHED)
424 #define mi_is_crashed_on_repair(x) \
425  ((x)->s->state.changed & STATE_CRASHED_ON_REPAIR)
426 #define mi_print_error(SHARE, ERRNO) \
427  mi_report_error((ERRNO), (SHARE)->index_file_name)
428 
429 /* Functions to store length of space packed keys, VARCHAR or BLOB keys */
430 
431 #define store_key_length(key, length) \
432  { \
433  if ((length) < 255) { \
434  *(key) = (length); \
435  } else { \
436  *(key) = 255; \
437  mi_int2store((key) + 1, (length)); \
438  } \
439  }
440 
441 #define get_key_full_length(length, key) \
442  { \
443  if ((uchar) * (key) != 255) \
444  length = ((uint)(uchar) * ((key)++)) + 1; \
445  else { \
446  length = mi_uint2korr((key) + 1) + 3; \
447  (key) += 3; \
448  } \
449  }
450 
451 #define get_key_full_length_rdonly(length, key) \
452  { \
453  if ((uchar) * (key) != 255) \
454  length = ((uint)(uchar) * ((key))) + 1; \
455  else { \
456  length = mi_uint2korr((key) + 1) + 3; \
457  } \
458  }
459 
460 #define get_pack_length(length) ((length) >= 255 ? 3 : 1)
461 
462 #define MI_MIN_BLOCK_LENGTH 20 /* Because of delete-link */
463 #define MI_EXTEND_BLOCK_LENGTH 20 /* Don't use to small record-blocks */
464 #define MI_SPLIT_LENGTH ((MI_EXTEND_BLOCK_LENGTH + 4) * 2)
465 #define MI_MAX_DYN_BLOCK_HEADER 20 /* Max prefix of record-block */
466 #define MI_BLOCK_INFO_HEADER_LENGTH 20
467 #define MI_DYN_DELETE_BLOCK_HEADER 20 /* length of delete-block-header */
468 #define MI_DYN_MAX_BLOCK_LENGTH ((1L << 24) - 4L)
469 #define MI_DYN_MAX_ROW_LENGTH (MI_DYN_MAX_BLOCK_LENGTH - MI_SPLIT_LENGTH)
470 #define MI_DYN_ALIGN_SIZE 4 /* Align blocks on this */
471 #define MI_MAX_DYN_HEADER_BYTE 13 /* max header byte for dynamic rows */
472 #define MI_MAX_BLOCK_LENGTH \
473  ((((ulong)1 << 24) - 1) & (~(ulong)(MI_DYN_ALIGN_SIZE - 1)))
474 #define MI_REC_BUFF_OFFSET \
475  ALIGN_SIZE(MI_DYN_DELETE_BLOCK_HEADER + sizeof(uint32))
476 
477 #define PACK_TYPE_SELECTED 1 /* Bits in field->pack_type */
478 #define PACK_TYPE_SPACE_FIELDS 2
479 #define PACK_TYPE_ZERO_FILL 4
480 #define MI_FOUND_WRONG_KEY 32738 /* Impossible value from ha_key_cmp */
481 
482 #define MI_MAX_KEY_BLOCK_SIZE \
483  (MI_MAX_KEY_BLOCK_LENGTH / MI_MIN_KEY_BLOCK_LENGTH)
484 #define MI_BLOCK_SIZE(key_length, data_pointer, key_pointer, block_size) \
485  (((((key_length) + (data_pointer) + (key_pointer)) * 4 + (key_pointer) + \
486  2) / \
487  (block_size) + \
488  1) * \
489  (block_size))
490 #define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */
491 #define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */
492 
493 #define MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */
494 #define MI_MIN_ROWS_TO_USE_BULK_INSERT 100
495 #define MI_MIN_ROWS_TO_DISABLE_INDEXES 100
496 #define MI_MIN_ROWS_TO_USE_WRITE_CACHE 10
497 
498 /* The UNIQUE check is done with a hashed long key */
499 
500 #define MI_UNIQUE_HASH_TYPE HA_KEYTYPE_ULONG_INT
501 #define mi_unique_store(A, B) mi_int4store((A), (B))
502 
504 
505 #ifdef __cplusplus
506 extern "C" {
507 #endif
508 
509 /* Some extern variables */
510 
511 extern LIST *myisam_open_list;
515 extern File myisam_log_file;
516 extern ulong myisam_pid;
517 
518 /* This is used by _mi_calc_xxx_key_length och _mi_store_key */
519 
520 struct MI_KEY_PARAM {
523  const uchar *key;
526 };
527 
528 /* Prototypes for intern functions */
529 
530 extern int _mi_read_dynamic_record(MI_INFO *info, my_off_t filepos, uchar *buf);
531 extern int _mi_write_dynamic_record(MI_INFO *, const uchar *);
532 extern int _mi_update_dynamic_record(MI_INFO *, my_off_t, const uchar *);
534 extern int _mi_cmp_dynamic_record(MI_INFO *info, const uchar *record);
535 extern int _mi_read_rnd_dynamic_record(MI_INFO *, uchar *, my_off_t, bool);
536 extern int _mi_write_blob_record(MI_INFO *, const uchar *);
537 extern int _mi_update_blob_record(MI_INFO *, my_off_t, const uchar *);
538 extern int _mi_read_static_record(MI_INFO *info, my_off_t filepos, uchar *buf);
539 extern int _mi_write_static_record(MI_INFO *, const uchar *);
540 extern int _mi_update_static_record(MI_INFO *, my_off_t, const uchar *);
542 extern int _mi_cmp_static_record(MI_INFO *info, const uchar *record);
543 extern int _mi_read_rnd_static_record(MI_INFO *, uchar *, my_off_t, bool);
544 extern int _mi_ck_write(MI_INFO *info, uint keynr, uchar *key, uint length);
546  uchar *key, uint key_length, my_off_t *root,
547  uint comp_flag);
549  my_off_t *root);
551  uchar *anc_buff, uchar *key_pos, uchar *key_buff,
552  uchar *father_buff, uchar *father_keypos,
553  my_off_t father_page, bool insert_last);
555  uchar *buff, uchar *key_buff, bool insert_last);
556 extern uchar *_mi_find_half_pos(uint nod_flag, MI_KEYDEF *keyinfo, uchar *page,
557  uchar *key, uint *return_key_length,
558  uchar **after_key);
559 extern int _mi_calc_static_key_length(MI_KEYDEF *keyinfo, uint nod_flag,
560  const uchar *key_pos, uchar *org_key,
561  uchar *key_buff, const uchar *key,
562  MI_KEY_PARAM *s_temp);
563 extern int _mi_calc_var_key_length(MI_KEYDEF *keyinfo, uint nod_flag,
564  const uchar *key_pos, uchar *org_key,
565  uchar *key_buff, const uchar *key,
566  MI_KEY_PARAM *s_temp);
567 extern int _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo, uint nod_flag,
568  const uchar *key_pos, uchar *org_key,
569  uchar *prev_key, const uchar *key,
570  MI_KEY_PARAM *s_temp);
571 extern int _mi_calc_bin_pack_key_length(MI_KEYDEF *keyinfo, uint nod_flag,
572  const uchar *key_pos, uchar *org_key,
573  uchar *prev_key, const uchar *key,
574  MI_KEY_PARAM *s_temp);
576  MI_KEY_PARAM *s_temp);
578  MI_KEY_PARAM *s_temp);
580  MI_KEY_PARAM *s_temp);
581 
582 extern int _mi_ck_delete(MI_INFO *info, uint keynr, uchar *key,
583  uint key_length);
584 extern int _mi_readinfo(MI_INFO *info, int lock_flag, int check_keybuffer);
585 extern int _mi_writeinfo(MI_INFO *info, uint options);
586 extern int _mi_test_if_changed(MI_INFO *info);
587 extern int _mi_mark_file_changed(MI_INFO *info);
589 extern int _mi_check_index(MI_INFO *info, int inx);
591  uint key_len, uint nextflag, my_off_t pos);
593  uchar *key, uint key_len, uint comp_flag,
594  uchar **ret_pos, uchar *buff, bool *was_last_key);
596  uchar *key, uint key_len, uint comp_flag,
597  uchar **ret_pos, uchar *buff, bool *was_last_key);
599  uchar *key, uint key_len, uint comp_flag,
600  uchar **ret_pos, uchar *buff, bool *was_last_key);
601 extern my_off_t _mi_kpos(uint nod_flag, uchar *after_key);
602 extern void _mi_kpointer(MI_INFO *info, uchar *buff, my_off_t pos);
603 extern my_off_t _mi_dpos(MI_INFO *info, uint nod_flag, const uchar *after_key);
605 extern void _mi_dpointer(MI_INFO *info, uchar *buff, my_off_t pos);
606 extern uint _mi_get_static_key(MI_KEYDEF *keyinfo, uint nod_flag, uchar **page,
607  uchar *key);
608 extern uint _mi_get_pack_key(MI_KEYDEF *keyinfo, uint nod_flag, uchar **page,
609  uchar *key);
611  uchar **page_pos, uchar *key);
613  uchar *lastkey, uchar *endpos,
614  uint *return_key_length);
616  uchar *key, uchar *keypos, uint *return_key_length);
617 extern uint _mi_keylength(MI_KEYDEF *keyinfo, const uchar *key);
619  HA_KEYSEG *end);
620 extern uchar *_mi_move_key(MI_KEYDEF *keyinfo, uchar *to, const uchar *from);
622  uint key_length, uint nextflag, my_off_t pos);
626  my_off_t page, int level, uchar *buff,
627  int return_buffer);
629  int level, uchar *buff);
631  int level);
632 extern my_off_t _mi_new(MI_INFO *info, MI_KEYDEF *keyinfo, int level);
633 extern uint _mi_make_key(MI_INFO *info, uint keynr, uchar *key,
634  const uchar *record, my_off_t filepos);
635 extern uint _mi_pack_key(MI_INFO *info, uint keynr, uchar *key,
636  const uchar *old, key_part_map keypart_map,
637  HA_KEYSEG **last_used_keyseg);
638 extern int _mi_read_key_record(MI_INFO *info, my_off_t filepos, uchar *buf);
639 extern int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos,
640  uint length, int re_read_if_possibly);
642 
643 extern uchar *mi_alloc_rec_buff(MI_INFO *, ulong, uchar **);
644 #define mi_get_rec_buff_ptr(info, buf) \
645  ((((info)->s->options & HA_OPTION_PACK_RECORD) && (buf)) \
646  ? (buf)-MI_REC_BUFF_OFFSET \
647  : (buf))
648 #define mi_get_rec_buff_len(info, buf) \
649  (*((uint32 *)(mi_get_rec_buff_ptr(info, buf))))
650 
651 extern ulong _mi_rec_unpack(MI_INFO *info, uchar *to, const uchar *from,
652  ulong reclength);
653 extern bool _mi_rec_check(MI_INFO *info, const uchar *record, uchar *packpos,
654  ulong packed_length, bool with_checkum);
655 extern int _mi_write_part_record(MI_INFO *info, my_off_t filepos, ulong length,
656  my_off_t next_filepos, uchar **record,
657  ulong *reclength, int *flag);
658 extern void _mi_print_key(FILE *stream, HA_KEYSEG *keyseg, const uchar *key,
659  uint length);
660 extern bool _mi_read_pack_info(MI_INFO *info, bool fix_keys);
661 extern int _mi_read_pack_record(MI_INFO *info, my_off_t filepos, uchar *buf);
662 extern int _mi_read_rnd_pack_record(MI_INFO *, uchar *, my_off_t, bool);
663 extern int _mi_pack_rec_unpack(MI_INFO *info, MI_BIT_BUFF *bit_buff, uchar *to,
664  uchar *from, ulong reclength);
666 extern int _mi_ft_update(MI_INFO *info, uint keynr, uchar *keybuf,
667  const uchar *oldrec, const uchar *newrec,
668  my_off_t pos);
669 
670 #ifdef __cplusplus
671 }
672 #endif
673 
674 struct MI_BLOCK_INFO { /* Parameter to _mi_get_block_info */
685 };
686 
687 /* bits in return from _mi_get_block_info */
688 
689 #define BLOCK_FIRST 1
690 #define BLOCK_LAST 2
691 #define BLOCK_DELETED 4
692 #define BLOCK_ERROR 8 /* Wrong data */
693 #define BLOCK_SYNC_ERROR 16 /* Right data at wrong place */
694 #define BLOCK_FATAL_ERROR 32 /* hardware-error */
695 
696 #define NEED_MEM ((uint)10 * 4 * (IO_SIZE + 32) + 32) /* Nead for recursion */
697 #define MAXERR 20
698 #define BUFFERS_WHEN_SORTING 16 /* Alloc for sort-key-tree */
699 #define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */
700 #define WRITE_COUNT MY_HOW_OFTEN_TO_WRITE
701 #define INDEX_TMP_EXT ".TMM"
702 #define DATA_TMP_EXT ".TMD"
703 
704 #define UPDATE_TIME 1
705 #define UPDATE_STAT 2
706 #define UPDATE_SORT 4
707 #define UPDATE_AUTO_INC 8
708 #define UPDATE_OPEN_COUNT 16
709 
710 #define USE_BUFFER_INIT (((1024L * 512L - MALLOC_OVERHEAD) / IO_SIZE) * IO_SIZE)
711 #define READ_BUFFER_INIT (1024L * 256L - MALLOC_OVERHEAD)
712 #define SORT_BUFFER_INIT (2048L * 1024L - MALLOC_OVERHEAD)
713 #define MIN_SORT_BUFFER (4096 - MALLOC_OVERHEAD)
714 
724 };
725 
726 #define myisam_log(a, b, c, d) \
727  if (myisam_log_file >= 0) _myisam_log(a, b, c, d)
728 #define myisam_log_command(a, b, c, d, e) \
729  if (myisam_log_file >= 0) _myisam_log_command(a, b, c, d, e)
730 #define myisam_log_record(a, b, c, d, e) \
731  if (myisam_log_file >= 0) _myisam_log_record(a, b, c, d, e)
732 
733 #define fast_mi_writeinfo(INFO) \
734  if (!(INFO)->s->tot_locks) (void)_mi_writeinfo((INFO), 0)
735 #define fast_mi_readinfo(INFO) \
736  ((INFO)->lock_type == F_UNLCK) && _mi_readinfo((INFO), F_RDLCK, 1)
737 
738 #ifdef __cplusplus
739 extern "C" {
740 #endif
741 
743 extern uint _mi_rec_pack(MI_INFO *info, uchar *to, const uchar *from);
744 extern uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
745  MI_BLOCK_INFO *info, uchar **rec_buff_p,
746  File file, my_off_t filepos);
747 extern void _mi_store_blob_length(uchar *pos, uint pack_length, uint length);
749  const uchar *buffert, uint length);
751  const uchar *buffert, uint length, int result);
753  const uchar *record, my_off_t filepos,
754  int result);
755 extern void mi_report_error(int errcode, const char *file_name);
756 extern bool _mi_memmap_file(MI_INFO *info);
757 extern void _mi_unmap_file(MI_INFO *info);
758 extern uint save_pack_length(uint version, uchar *block_buff, ulong length);
759 extern uint read_pack_length(uint version, const uchar *buf, ulong *length);
761 extern size_t mi_mmap_pread(MI_INFO *info, uchar *Buffer, size_t Count,
762  my_off_t offset, myf MyFlags);
763 extern size_t mi_mmap_pwrite(MI_INFO *info, const uchar *Buffer, size_t Count,
764  my_off_t offset, myf MyFlags);
765 extern size_t mi_nommap_pread(MI_INFO *info, uchar *Buffer, size_t Count,
766  my_off_t offset, myf MyFlags);
767 extern size_t mi_nommap_pwrite(MI_INFO *info, const uchar *Buffer, size_t Count,
768  my_off_t offset, myf MyFlags);
769 
770 uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite);
772 uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, bool pRead);
775 int mi_keyseg_write(File file, const HA_KEYSEG *keyseg);
777 uint mi_keydef_write(File file, MI_KEYDEF *keydef);
778 uchar *mi_keydef_read(uchar *ptr, MI_KEYDEF *keydef);
780 uchar *mi_uniquedef_read(uchar *ptr, MI_UNIQUEDEF *keydef);
783 extern int mi_disable_indexes(MI_INFO *info);
784 extern int mi_enable_indexes(MI_INFO *info);
791 ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *buf);
793  my_off_t pos);
795  const uchar *record, my_off_t pos);
796 int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b,
797  bool null_are_equal);
798 void mi_get_status(void *param, int concurrent_insert);
799 void mi_update_status(void *param);
800 void mi_restore_status(void *param);
801 void mi_copy_status(void *to, void *from);
802 bool mi_check_status(void *param);
803 
804 extern MI_INFO *test_if_reopen(char *filename);
805 bool check_table_is_closed(const char *name, const char *where);
806 int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *orn_name,
807  File file_to_dup);
808 
809 int mi_open_keyfile(MYISAM_SHARE *share);
810 void mi_setup_functions(MYISAM_SHARE *share);
811 bool mi_dynmap_file(MI_INFO *info, my_off_t size);
813 void mi_remap_file(MI_INFO *info, my_off_t size);
814 void _mi_report_crashed(MI_INFO *file, const char *message, const char *sfile,
815  uint sline);
816 
818 
819 /* Functions needed by mi_check */
820 volatile int *killed_ptr(MI_CHECK *param);
821 void mi_check_print_error(MI_CHECK *param, const char *fmt, ...)
822  MY_ATTRIBUTE((format(printf, 2, 3)));
823 void mi_check_print_warning(MI_CHECK *param, const char *fmt, ...)
824  MY_ATTRIBUTE((format(printf, 2, 3)));
825 void mi_check_print_info(MI_CHECK *param, const char *fmt, ...)
826  MY_ATTRIBUTE((format(printf, 2, 3)));
828 int sort_ft_buf_flush(MI_SORT_PARAM *sort_param);
829 int thr_write_keys(MI_SORT_PARAM *sort_param);
830 void *thr_find_all_keys(void *arg);
831 int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file);
832 
833 int sort_write_record(MI_SORT_PARAM *sort_param);
834 int _create_index_by_sort(MI_SORT_PARAM *info, bool no_messages, ulonglong);
835 
837  void *func_arg);
838 
839 #ifdef __cplusplus
840 extern thread_local st_keycache_thread_var *keycache_tls;
841 }
842 #endif
843 
844 #ifdef HAVE_PSI_INTERFACE
847 
850 
853 
856 
858 
859 void init_myisam_psi_keys();
860 #endif /* HAVE_PSI_INTERFACE */
861 
884 
885 #endif // STORAGE_MYISAM_MYISAMDEF_INCLUDED
myisam_pid
ulong myisam_pid
Definition: mi_log.cc:47
PSI_file_key
unsigned int PSI_file_key
Instrumented file key.
Definition: psi_file_bits.h:46
_mi_write_dynamic_record
int _mi_write_dynamic_record(MI_INFO *, const uchar *)
Definition: mi_dynrec.cc:244
MI_INFO::update
uint update
Definition: myisamdef.h:291
MI_BASE_INFO::pack_fields
ulong pack_fields
Definition: myisamdef.h:142
MI_INFO::blobs
MI_BLOB * blobs
Definition: myisamdef.h:253
MYISAM_SHARE::keyparts
HA_KEYSEG * keyparts
Definition: myisamdef.h:181
MI_INFO::int_keytree_version
uint32 int_keytree_version
Definition: myisamdef.h:272
MI_INFO::dupp_key_pos
my_off_t dupp_key_pos
Definition: myisamdef.h:284
MI_STATE_INFO::header
struct MI_STATE_INFO::@140 header
MI_INFO::packed_length
ulong packed_length
Definition: myisamdef.h:288
_mi_write_part_record
int _mi_write_part_record(MI_INFO *info, my_off_t filepos, ulong length, my_off_t next_filepos, uchar **record, ulong *reclength, int *flag)
Definition: mi_dynrec.cc:543
_mi_dpointer
void _mi_dpointer(MI_INFO *info, uchar *buff, my_off_t pos)
Definition: mi_search.cc:650
MI_BASE_INFO::rec_reflength
uint rec_reflength
Definition: myisamdef.h:143
MI_SORT_PARAM::notnull
ulonglong notnull[MI_MAX_KEY_SEG+1]
Definition: myisamdef.h:348
_mi_make_key
uint _mi_make_key(MI_INFO *info, uint keynr, uchar *key, const uchar *record, my_off_t filepos)
Definition: mi_key.cc:62
MYISAM_SHARE::compare_record
int(* compare_record)(MI_INFO *, const uchar *)
Definition: myisamdef.h:198
retrieve_auto_increment
ulonglong retrieve_auto_increment(MI_INFO *info, const uchar *record)
Definition: mi_key.cc:443
PSI_mutex_key
unsigned int PSI_mutex_key
Instrumented mutex key.
Definition: psi_mutex_bits.h:49
MI_BLOB::length
ulong length
Definition: myisamdef.h:164
mi_check_index_cond
int mi_check_index_cond(MI_INFO *info, uint keynr, uchar *record)
Definition: mi_key.cc:421
read_pack_length
uint read_pack_length(uint version, const uchar *buf, ulong *length)
Definition: mi_packrec.cc:1488
myisampack.h
BUFFPEK::file_pos
my_off_t file_pos
Definition: myisamdef.h:330
MI_STATUS_INFO::uncacheable
bool uncacheable
Definition: myisamdef.h:63
_mi_get_static_key
uint _mi_get_static_key(MI_KEYDEF *keyinfo, uint nod_flag, uchar **page, uchar *key)
Definition: mi_search.cc:691
MI_SORT_PARAM::fix_datafile
bool fix_datafile
Definition: myisamdef.h:354
mi_key_memory_MI_DECODE_TREE
PSI_memory_key mi_key_memory_MI_DECODE_TREE
Definition: mi_static.cc:114
MYISAM_SHARE::pack
MI_PACK pack
Definition: myisamdef.h:183
_mi_pack_key
uint _mi_pack_key(MI_INFO *info, uint keynr, uchar *key, const uchar *old, key_part_map keypart_map, HA_KEYSEG **last_used_keyseg)
Definition: mi_key.cc:196
MI_BIT_BUFF
Definition: myisamdef.h:241
MI_INFO::rtree_recursion_state
uchar * rtree_recursion_state
Definition: myisamdef.h:325
MI_INFO::errkey
int errkey
Definition: myisamdef.h:299
MI_BLOCK_INFO::rec_len
ulong rec_len
Definition: myisamdef.h:676
File
int File
Definition: my_io_bits.h:50
MI_INFO::set_rnext_same_key
bool set_rnext_same_key
Definition: myisamdef.h:317
_mi_memmap_file
bool _mi_memmap_file(MI_INFO *info)
Definition: mi_packrec.cc:1336
mi_key_memory_ft_memroot
PSI_memory_key mi_key_memory_ft_memroot
Definition: mi_static.cc:106
_my_calc_total_blob_length
ulong _my_calc_total_blob_length(MI_INFO *info, const uchar *record)
Definition: mi_dynrec.cc:1152
MI_SORT_PARAM::thr
my_thread_handle thr
Definition: myisamdef.h:338
MYISAM_SHARE::decode_tables
uint16 * decode_tables
Definition: myisamdef.h:192
mi_remap_file
void mi_remap_file(MI_INFO *info, my_off_t size)
Definition: mi_dynrec.cc:147
_mi_store_bin_pack_key
void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos, MI_KEY_PARAM *s_temp)
Definition: mi_search.cc:1690
MI_BASE_INFO
Definition: myisamdef.h:129
MI_BLOCK_INFO::blob_len
ulong blob_len
Definition: myisamdef.h:679
MI_SORT_PARAM::keyinfo
MI_KEYDEF * keyinfo
Definition: myisamdef.h:356
init_myisam_psi_keys
void init_myisam_psi_keys()
Definition: mi_static.cc:210
MI_PACK::version
uchar version
Definition: myisamdef.h:170
_mi_print_key
void _mi_print_key(FILE *stream, HA_KEYSEG *keyseg, const uchar *key, uint length)
Definition: mi_dbug.cc:33
mi_checksum
ha_checksum mi_checksum(MI_INFO *info, const uchar *buf)
Definition: mi_checksum.cc:32
MYISAM_SHARE::mmaped_length
my_off_t mmaped_length
Definition: myisamdef.h:233
MYISAM_SHARE::uniqueinfo
MI_UNIQUEDEF * uniqueinfo
Definition: myisamdef.h:180
myisam_log_file
File myisam_log_file
Definition: mi_static.cc:54
MI_SORT_PARAM::sort_info
SORT_INFO * sort_info
Definition: myisamdef.h:358
MI_INFO::save_update
uint save_update
Definition: myisamdef.h:303
sort_ft_buf_flush
int sort_ft_buf_flush(MI_SORT_PARAM *sort_param)
Definition: mi_check.cc:3467
MI_INFO::last_used_keyseg
uint16 last_used_keyseg
Definition: myisamdef.h:298
MI_BLOCK_INFO::block_len
ulong block_len
Definition: myisamdef.h:678
_create_index_by_sort
int _create_index_by_sort(MI_SORT_PARAM *info, bool no_messages, ulonglong)
Definition: sort.cc:108
MYISAM_SHARE::have_rtree
bool have_rtree
Definition: myisamdef.h:228
mi_static_checksum
ha_checksum mi_static_checksum(MI_INFO *info, const uchar *buf)
Definition: mi_checksum.cc:67
MI_SORT_PARAM::read_cache
IO_CACHE read_cache
Definition: myisamdef.h:339
mi_set_index_cond_func
void mi_set_index_cond_func(MI_INFO *info, index_cond_func_t func, void *func_arg)
Definition: mi_extra.cc:210
record
Definition: mi_test3.cc:54
MI_SORT_PARAM::read_to_buffer
uint(* read_to_buffer)(IO_CACHE *, BUFFPEK *, uint)
Definition: myisamdef.h:369
MYISAM_SHARE::delete_record
int(* delete_record)(MI_INFO *)
Definition: myisamdef.h:196
MI_SORT_PARAM::wordlist
void * wordlist
Definition: myisamdef.h:361
MI_KEY_PARAM::n_ref_length
uint n_ref_length
Definition: myisamdef.h:521
MI_INFO::index_cond_func
index_cond_func_t index_cond_func
Definition: myisamdef.h:319
MYISAM_SHARE::data_file_name
char * data_file_name
Definition: myisamdef.h:187
MI_INFO::preload_buff_size
uint preload_buff_size
Definition: myisamdef.h:307
version
const string version("\"Version\"")
_mi_dispose
int _mi_dispose(MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos, int level)
Definition: mi_page.cc:101
_mi_ck_real_write_btree
int _mi_ck_real_write_btree(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint key_length, my_off_t *root, uint comp_flag)
Definition: mi_write.cc:248
MI_INFO::first_mbr_key
uchar * first_mbr_key
Definition: myisamdef.h:267
MI_PACK::header_length
ulong header_length
Definition: myisamdef.h:168
MYSQL_FTPARSER_PARAM
Definition: plugin_ftparser.h:190
MYISAM_SHARE::options
ulong options
Definition: myisamdef.h:208
MI_INFO::in_use
LIST in_use
Definition: myisamdef.h:260
MI_INFO::lock
THR_LOCK_DATA lock
Definition: myisamdef.h:324
test_if_reopen
MI_INFO * test_if_reopen(char *filename)
Definition: mi_open.cc:79
_mi_delete_dynamic_record
int _mi_delete_dynamic_record(MI_INFO *info)
Definition: mi_dynrec.cc:302
MI_STATE_INFO::options
uchar options[2]
Definition: myisamdef.h:69
mi_key_memory_preload_buffer
PSI_memory_key mi_key_memory_preload_buffer
Definition: mi_static.cc:116
MI_LOG_OPEN
@ MI_LOG_OPEN
Definition: myisamdef.h:716
myisam_log_commands
myisam_log_commands
Definition: myisamdef.h:715
MY_TMPDIR
Definition: my_sys.h:308
MYISAM_SHARE::w_locks
uint w_locks
Definition: myisamdef.h:219
MI_STATE_INFO::changed
uint8 changed
Definition: myisamdef.h:107
MI_SORT_PARAM::rec_buff
uchar * rec_buff
Definition: myisamdef.h:360
MI_SORT_PARAM::key
uint key
Definition: myisamdef.h:352
mi_key_memory_MI_INFO
PSI_memory_key mi_key_memory_MI_INFO
Definition: mi_static.cc:99
pos
char * pos
Definition: do_ctype.cc:76
_mi_seq_search
int _mi_seq_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint key_len, uint comp_flag, uchar **ret_pos, uchar *buff, bool *was_last_key)
Definition: mi_search.cc:239
THR_LOCK_myisam
mysql_mutex_t THR_LOCK_myisam
Definition: my_thr_init.cc:72
mysql_rwlock_t
An instrumented rwlock structure.
Definition: mysql_rwlock_bits.h:50
mi_check_unique
bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record, ha_checksum unique_hash, my_off_t pos)
Definition: mi_unique.cc:36
mi_key_memory_SORT_FT_BUF
PSI_memory_key mi_key_memory_SORT_FT_BUF
Definition: mi_static.cc:110
MI_SORT_PARAM::find_length
uint find_length
Definition: myisamdef.h:353
HA_KEYSEG
Definition: my_compare.h:58
mi_open_datafile
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *orn_name, File file_to_dup)
Definition: mi_open.cc:1228
MI_STATE_INFO::file_version
uchar file_version[4]
Definition: myisamdef.h:68
MI_INFO::save_state
MI_STATUS_INFO save_state
Definition: myisamdef.h:252
MI_STATUS_INFO::del
ha_rows del
Definition: myisamdef.h:57
MI_INFO::save_lastpos
my_off_t save_lastpos
Definition: myisamdef.h:280
mi_key_memory_SORT_KEY_BLOCKS
PSI_memory_key mi_key_memory_SORT_KEY_BLOCKS
Definition: mi_static.cc:111
mysql_rwlock.h
mi_enable_indexes
int mi_enable_indexes(MI_INFO *info)
Definition: mi_open.cc:1306
MI_KEY_PARAM::store_not_null
bool store_not_null
Definition: myisamdef.h:525
unique_hash
ulonglong unique_hash(const Field *field, ulonglong *hash_val)
Generate hash for a field.
Definition: sql_executor.cc:5645
mysql_mutex_t
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
data_file_type
data_file_type
Definition: my_base.h:1062
MI_STATE_INFO::rec_per_key_rows
my_off_t rec_per_key_rows
Definition: myisamdef.h:95
mi_key_memory_keycache_thread_var
PSI_memory_key mi_key_memory_keycache_thread_var
Definition: mi_static.cc:118
mi_mmap_pread
size_t mi_mmap_pread(MI_INFO *info, uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags)
Definition: mi_dynrec.cc:169
mysql_file.h
MYISAM_SHARE::in_use
LIST * in_use
Definition: myisamdef.h:185
MI_KEY_PARAM::n_length
uint n_length
Definition: myisamdef.h:521
MI_INFO::int_maxpos
uchar * int_maxpos
Definition: myisamdef.h:270
result
Definition: result.h:33
_mi_pack_get_block_info
uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff, MI_BLOCK_INFO *info, uchar **rec_buff_p, File file, my_off_t filepos)
Definition: mi_packrec.cc:1219
key_part_map
ulong key_part_map
Definition: my_base.h:1000
MI_BLOCK_INFO_HEADER_LENGTH
#define MI_BLOCK_INFO_HEADER_LENGTH
Definition: myisamdef.h:466
my_off_t
ulonglong my_off_t
Definition: my_inttypes.h:71
_mi_get_last_key
uchar * _mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *keypos, uchar *lastkey, uchar *endpos, uint *return_key_length)
Definition: mi_search.cc:1009
_mi_search_next
int _mi_search_next(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint key_length, uint nextflag, my_off_t pos)
Definition: mi_search.cc:1100
MI_INFO::state
MI_STATUS_INFO * state
Definition: myisamdef.h:252
MI_INFO::pack_key_length
uint pack_key_length
Definition: myisamdef.h:297
PSI_memory_key
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:46
_mi_bin_search
int _mi_bin_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint key_len, uint comp_flag, uchar **ret_pos, uchar *buff, bool *was_last_key)
Definition: mi_search.cc:180
_mi_new
my_off_t _mi_new(MI_INFO *info, MI_KEYDEF *keyinfo, int level)
Definition: mi_page.cc:119
MYISAM_SHARE::rec_reflength
uint rec_reflength
Definition: myisamdef.h:212
_mi_calc_var_key_length
int _mi_calc_var_key_length(MI_KEYDEF *keyinfo, uint nod_flag, const uchar *key_pos, uchar *org_key, uchar *key_buff, const uchar *key, MI_KEY_PARAM *s_temp)
Definition: mi_search.cc:1275
my_icp.h
MI_STATE_INFO::create_time
time_t create_time
Definition: myisamdef.h:102
MI_BIT_BUFF::error
uint error
Definition: myisamdef.h:245
mi_key_memory_MYISAM_SHARE
PSI_memory_key mi_key_memory_MYISAM_SHARE
Definition: mi_static.cc:98
index_cond_func_t
ICP_RESULT(* index_cond_func_t)(void *param)
Definition: myisamdef.h:248
MI_BASE_INFO::min_block_length
ulong min_block_length
Definition: myisamdef.h:140
_mi_read_dynamic_record
int _mi_read_dynamic_record(MI_INFO *info, my_off_t filepos, uchar *buf)
Definition: mi_dynrec.cc:1232
_mi_test_if_changed
int _mi_test_if_changed(MI_INFO *info)
Definition: mi_locking.cc:434
mi_indexes_are_disabled
int mi_indexes_are_disabled(MI_INFO *info)
Definition: mi_open.cc:1335
MI_KEYDEF
Definition: myisam.h:171
mi_key_memory_FTPARSER_PARAM
PSI_memory_key mi_key_memory_FTPARSER_PARAM
Definition: mi_static.cc:105
_mi_rec_check
bool _mi_rec_check(MI_INFO *info, const uchar *record, uchar *packpos, ulong packed_length, bool with_checkum)
Definition: mi_dynrec.cc:954
_mi_report_crashed
void _mi_report_crashed(MI_INFO *file, const char *message, const char *sfile, uint sline)
Report list of threads (and queries) accessing a table, thread_id of a thread that detected corruptio...
Definition: ha_myisam.cc:609
MYISAM_SHARE::nonmmaped_inserts
uint nonmmaped_inserts
Definition: myisamdef.h:234
MI_INFO::last_search_keypage
my_off_t last_search_keypage
Definition: myisamdef.h:283
mi_open_keyfile
int mi_open_keyfile(MYISAM_SHARE *share)
Definition: mi_open.cc:1258
MYISAM_SHARE::keyinfo
MI_KEYDEF * keyinfo
Definition: myisamdef.h:179
_mi_mark_file_changed
int _mi_mark_file_changed(MI_INFO *info)
Definition: mi_locking.cc:473
_mi_check_index
int _mi_check_index(MI_INFO *info, int inx)
Definition: mi_search.cc:45
ha_checksum
uint32 ha_checksum
Definition: my_sys.h:538
MI_STATE_INFO::version
ulong version
Definition: myisamdef.h:101
MI_SORT_PARAM::wordroot
MEM_ROOT wordroot
Definition: myisamdef.h:362
MI_INFO::lock_wait
myf lock_wait
Definition: myisamdef.h:308
mi_bit_type
uint mi_bit_type
Definition: myisamdef.h:239
_mi_insert
int _mi_insert(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uchar *anc_buff, uchar *key_pos, uchar *key_buff, uchar *father_buff, uchar *father_keypos, my_off_t father_page, bool insert_last)
Definition: mi_write.cc:402
MI_INFO::was_locked
bool was_locked
Definition: myisamdef.h:309
mi_base_info_write
uint mi_base_info_write(File file, MI_BASE_INFO *base)
Definition: mi_open.cc:970
_mi_readinfo
int _mi_readinfo(MI_INFO *info, int lock_flag, int check_keybuffer)
Definition: mi_locking.cc:368
_mi_cmp_static_record
int _mi_cmp_static_record(MI_INFO *info, const uchar *record)
Definition: mi_statrec.cc:106
mi_key_memory_ft_stopwords
PSI_memory_key mi_key_memory_ft_stopwords
Definition: mi_static.cc:107
mi_key_file_datatmp
PSI_file_key mi_key_file_datatmp
Definition: mi_static.cc:156
MI_STATE_INFO::fulltext_keys
uchar fulltext_keys
Definition: myisamdef.h:80
_mi_ck_delete
int _mi_ck_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
Definition: mi_delete.cc:133
MYISAM_SHARE::not_flushed
bool not_flushed
Definition: myisamdef.h:228
MI_STATE_INFO::state_info_length
uchar state_info_length[2]
Definition: myisamdef.h:71
MYISAM_SHARE::changed
bool changed
Definition: myisamdef.h:226
mi_key_rwlock_MYISAM_SHARE_mmap_lock
PSI_rwlock_key mi_key_rwlock_MYISAM_SHARE_mmap_lock
Definition: myisamdef.h:849
_mi_ck_write
int _mi_ck_write(MI_INFO *info, uint keynr, uchar *key, uint length)
Definition: mi_write.cc:208
_myisam_log_command
void _myisam_log_command(enum myisam_log_commands command, MI_INFO *info, const uchar *buffert, uint length, int result)
Definition: mi_log.cc:95
key
static const char * key
Definition: suite_stubs.c:14
_mi_update_static_record
int _mi_update_static_record(MI_INFO *, my_off_t, const uchar *)
Definition: mi_statrec.cc:87
_mi_update_dynamic_record
int _mi_update_dynamic_record(MI_INFO *, my_off_t, const uchar *)
Definition: mi_dynrec.cc:249
MI_SORT_PARAM::write_keys
int(* write_keys)(MI_SORT_PARAM *, uchar **, uint, BUFFPEK *, IO_CACHE *)
Definition: myisamdef.h:368
MI_SORT_PARAM::start_recpos
my_off_t start_recpos
Definition: myisamdef.h:351
_mi_store_blob_length
void _mi_store_blob_length(uchar *pos, uint pack_length, uint length)
Definition: mi_dynrec.cc:1181
MI_SORT_PARAM::calc_checksum
bool calc_checksum
Definition: myisamdef.h:355
myisam_file_magic
uchar myisam_file_magic[]
Definition: mi_static.cc:41
mi_key_memory_SORT_INFO_buffer
PSI_memory_key mi_key_memory_SORT_INFO_buffer
Definition: mi_static.cc:113
_mi_update_blob_record
int _mi_update_blob_record(MI_INFO *, my_off_t, const uchar *)
Definition: mi_dynrec.cc:280
MI_KEY_PARAM::totlength
uint totlength
Definition: myisamdef.h:521
mi_keydef_read
uchar * mi_keydef_read(uchar *ptr, MI_KEYDEF *keydef)
Definition: mi_open.cc:1090
MI_INFO::lastkey
uchar * lastkey
Definition: myisamdef.h:263
SORT_INFO
Definition: myisam.h:390
record
struct record record
MI_STATE_INFO::state_diff_length
uint state_diff_length
Definition: myisamdef.h:110
MI_INFO::int_keypos
uchar * int_keypos
Definition: myisamdef.h:269
_mi_dpos
my_off_t _mi_dpos(MI_INFO *info, uint nod_flag, const uchar *after_key)
Definition: mi_search.cc:570
MI_STATE_INFO::recover_time
time_t recover_time
Definition: myisamdef.h:103
mi_get_status
void mi_get_status(void *param, int concurrent_insert)
Definition: mi_locking.cc:261
MYISAM_SHARE::temporary
bool temporary
Definition: myisamdef.h:228
MI_BASE_INFO::records
ha_rows records
Definition: myisamdef.h:134
MI_INFO::last_keypage
my_off_t last_keypage
Definition: myisamdef.h:282
MI_KEY_PARAM::pack_marker
uint pack_marker
Definition: myisamdef.h:522
my_alloc.h
mi_check_print_info
void mi_check_print_info(MI_CHECK *param, const char *fmt,...)
Definition: ha_myisam.cc:580
MI_INFO::bulk_insert
TREE * bulk_insert
Definition: myisamdef.h:256
mi_update_status
void mi_update_status(void *param)
Definition: mi_locking.cc:281
MI_INFO::last_rkey_length
uint last_rkey_length
Definition: myisamdef.h:294
_mi_read_key_record
int _mi_read_key_record(MI_INFO *info, my_off_t filepos, uchar *buf)
Definition: mi_key.cc:387
MI_SORT_PARAM::tmpdir
MY_TMPDIR * tmpdir
Definition: myisamdef.h:364
mi_key_memory_MYISAM_SHARE_decode_tables
PSI_memory_key mi_key_memory_MYISAM_SHARE_decode_tables
Definition: mi_static.cc:115
BUFFPEK::count
ha_rows count
Definition: myisamdef.h:332
myisam_read_vec
uint myisam_read_vec[]
Definition: mi_static.cc:80
MYISAM_SHARE::intern_lock
mysql_mutex_t intern_lock
Definition: myisamdef.h:231
MI_BLOCK_INFO::header
uchar header[MI_BLOCK_INFO_HEADER_LENGTH]
Definition: myisamdef.h:675
mi_key_memory_FT_INFO
PSI_memory_key mi_key_memory_FT_INFO
Definition: mi_static.cc:104
MI_STATE_INFO::base_info_length
uchar base_info_length[2]
Definition: myisamdef.h:72
_mi_read_cache
int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length, int re_read_if_possibly)
Definition: mi_cache.cc:50
MI_BASE_INFO::extra_alloc_procent
uint extra_alloc_procent
Definition: myisamdef.h:153
MI_INFO::open_list
LIST open_list
Definition: myisamdef.h:305
_mi_keylength_part
uint _mi_keylength_part(MI_KEYDEF *keyinfo, const uchar *key, HA_KEYSEG *end)
Definition: mi_search.cc:1073
MI_SORT_PARAM::master
bool master
Definition: myisamdef.h:354
MI_INFO::this_unique
ulong this_unique
Definition: myisamdef.h:274
MI_INFO::lastkey_length
uint lastkey_length
Definition: myisamdef.h:293
MI_BLOCK_INFO::next_filepos
my_off_t next_filepos
Definition: myisamdef.h:681
dd::info_schema::options
static const Query_options options
Definition: show_query_builder.cc:48
_mi_keylength
uint _mi_keylength(MI_KEYDEF *keyinfo, const uchar *key)
Definition: mi_search.cc:1045
MI_LOG_WRITE
@ MI_LOG_WRITE
Definition: myisamdef.h:717
MI_SORT_PARAM::filepos
my_off_t filepos
Definition: myisamdef.h:351
MYISAM_SHARE::index_file_name
char * index_file_name
Definition: myisamdef.h:188
my_n_base_info_read
uchar * my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base)
Definition: mi_open.cc:1019
_mi_writeinfo
int _mi_writeinfo(MI_INFO *info, uint options)
Definition: mi_locking.cc:396
MI_INFO::buff_used
bool buff_used
Definition: myisamdef.h:313
_mi_read_static_record
int _mi_read_static_record(MI_INFO *info, my_off_t filepos, uchar *buf)
Definition: mi_statrec.cc:147
MI_INFO::data_changed
uint data_changed
Definition: myisamdef.h:302
MYISAM_SHARE::this_process
ulong this_process
Definition: myisamdef.h:205
MI_LOG_DELETE_ALL
@ MI_LOG_DELETE_ALL
Definition: myisamdef.h:723
MYISAM_SHARE::update_record
int(* update_record)(MI_INFO *, my_off_t, const uchar *)
Definition: myisamdef.h:195
flush_pending_blocks
int flush_pending_blocks(MI_SORT_PARAM *param)
Definition: mi_check.cc:3732
mi_state_info_read_dsk
uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, bool pRead)
Definition: mi_open.cc:952
MI_BASE_INFO::keys
uint keys
Definition: myisamdef.h:145
MI_STATE_INFO::rec_per_key_part
ulong * rec_per_key_part
Definition: myisamdef.h:92
MI_SORT_PARAM::sortbuff_size
ulonglong sortbuff_size
Definition: myisamdef.h:349
MI_LOG_LOCK
@ MI_LOG_LOCK
Definition: myisamdef.h:722
mysql_thread.h
mi_recinfo_write
uint mi_recinfo_write(File file, MI_COLUMNDEF *recinfo)
Definition: mi_open.cc:1194
MI_INFO::quick_mode
bool quick_mode
Definition: myisamdef.h:311
mi_munmap_file
int mi_munmap_file(MI_INFO *info)
Definition: mi_dynrec.cc:124
KEY_CACHE
Definition: keycache.h:70
mi_key_file_dfile
PSI_file_key mi_key_file_dfile
Definition: myisamdef.h:854
killed_ptr
volatile int * killed_ptr(MI_CHECK *param)
Definition: ha_myisam.cc:566
MI_BIT_BUFF::end
uchar * end
Definition: myisamdef.h:244
MI_BASE_INFO::margin_key_file_length
my_off_t margin_key_file_length
Definition: myisamdef.h:133
MYISAM_SHARE::global_changed
bool global_changed
Definition: myisamdef.h:227
_mi_calc_var_pack_key_length
int _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo, uint nod_flag, const uchar *key_pos, uchar *org_key, uchar *prev_key, const uchar *key, MI_KEY_PARAM *s_temp)
Definition: mi_search.cc:1303
MI_SORT_PARAM::tempfile
IO_CACHE tempfile
Definition: myisamdef.h:339
mi_state_info_read
uchar * mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
Definition: mi_open.cc:878
MI_SORT_PARAM::bit_buff
MI_BIT_BUFF bit_buff
Definition: myisamdef.h:341
recinfo
static MI_COLUMNDEF recinfo[4]
Definition: mi_test1.cc:45
mi_key_memory_filecopy
PSI_memory_key mi_key_memory_filecopy
Definition: mi_static.cc:112
mi_recinfo_read
uchar * mi_recinfo_read(uchar *ptr, MI_COLUMNDEF *recinfo)
Definition: mi_open.cc:1208
MI_SORT_PARAM::sort_keys_length
uint sort_keys_length
Definition: myisamdef.h:353
MI_SORT_PARAM::unique
ulonglong unique[MI_MAX_KEY_SEG+1]
Definition: myisamdef.h:347
MI_LOG_UPDATE
@ MI_LOG_UPDATE
Definition: myisamdef.h:718
MI_BLOCK_INFO::second_read
uint second_read
Definition: myisamdef.h:683
MI_STATE_INFO::keys
uchar keys
Definition: myisamdef.h:76
MI_INFO::once_flags
uint8 once_flags
Definition: myisamdef.h:314
MYISAM_SHARE::last_process
ulong last_process
Definition: myisamdef.h:206
MI_LOG_DELETE
@ MI_LOG_DELETE
Definition: myisamdef.h:719
MYISAM_SHARE::key_cache
KEY_CACHE * key_cache
Definition: myisamdef.h:190
MI_INFO::ft1_to_ft2
DYNAMIC_ARRAY * ft1_to_ft2
Definition: myisamdef.h:257
MI_STATE_INFO::uniques
uchar uniques
Definition: myisamdef.h:77
MI_SORT_PARAM::key_write
int(* key_write)(MI_SORT_PARAM *, const void *)
Definition: myisamdef.h:367
MI_SORT_PARAM::sort_keys
uchar ** sort_keys
Definition: myisamdef.h:359
PSI_cond_key
unsigned int PSI_cond_key
Instrumented cond key.
Definition: psi_cond_bits.h:41
MI_STATE_INFO::key_del
my_off_t * key_del
Definition: myisamdef.h:94
MI_BASE_INFO::max_key_length
uint max_key_length
Definition: myisamdef.h:150
MI_INFO::opt_flag
uint opt_flag
Definition: myisamdef.h:290
MI_KEY_PARAM::prev_key
uchar * prev_key
Definition: myisamdef.h:524
MEM_ROOT
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:77
keyseg
static HA_KEYSEG keyseg[10]
Definition: mi_test1.cc:47
MYISAM_SHARE::mmap_lock
mysql_rwlock_t mmap_lock
Definition: myisamdef.h:236
thr_write_keys
int thr_write_keys(MI_SORT_PARAM *sort_param)
Definition: sort.cc:459
MI_STATUS_INFO::checksum
ha_checksum checksum
Definition: myisamdef.h:62
mi_nommap_pwrite
size_t mi_nommap_pwrite(MI_INFO *info, const uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags)
Definition: mi_dynrec.cc:239
MI_INFO::ft_memroot
MEM_ROOT ft_memroot
Definition: myisamdef.h:258
_mi_search_last
int _mi_search_last(MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos)
Definition: mi_search.cc:1214
MYISAM_SHARE::state_diff_length
ulong state_diff_length
Definition: myisamdef.h:211
_mi_cmp_dynamic_record
int _mi_cmp_dynamic_record(MI_INFO *info, const uchar *record)
Definition: mi_dynrec.cc:1353
mi_safe_mul
ulonglong mi_safe_mul(ulonglong a, ulonglong b)
Definition: mi_open.cc:691
thr_find_all_keys
void * thr_find_all_keys(void *arg)
Definition: sort.cc:294
MI_SORT_PARAM::record
uchar * record
Definition: myisamdef.h:363
MI_LOG_CLOSE
@ MI_LOG_CLOSE
Definition: myisamdef.h:720
MI_STATE_INFO::key_map
ulonglong key_map
Definition: myisamdef.h:99
MI_BLOCK_INFO
Definition: myisamdef.h:674
keyinfo
static MI_KEYDEF keyinfo[10]
Definition: mi_test1.cc:46
_mi_delete_static_record
int _mi_delete_static_record(MI_INFO *info)
Definition: mi_statrec.cc:93
MI_INFO::rec_buff
uchar * rec_buff
Definition: myisamdef.h:268
MYISAM_SHARE::min_pack_length
ulong min_pack_length
Definition: myisamdef.h:209
MI_BASE_INFO::blobs
uint blobs
Definition: myisamdef.h:147
MI_SORT_PARAM::key_read
int(* key_read)(MI_SORT_PARAM *, void *)
Definition: myisamdef.h:366
MI_BASE_INFO::keystart
my_off_t keystart
Definition: myisamdef.h:130
page
int page
Definition: ctype-mb.cc:1232
MI_SORT_PARAM::maxbuffers
uint maxbuffers
Definition: myisamdef.h:353
_mi_split_page
int _mi_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uchar *buff, uchar *key_buff, bool insert_last)
Definition: mi_write.cc:514
myisam_readnext_vec
uint myisam_readnext_vec[]
Definition: myisamdef.h:513
mi_keydef_write
uint mi_keydef_write(File file, MI_KEYDEF *keydef)
Definition: mi_open.cc:1071
mi_key_memory_MI_SORT_PARAM_wordroot
PSI_memory_key mi_key_memory_MI_SORT_PARAM_wordroot
Definition: mi_static.cc:109
MI_SORT_PARAM::wordptr
void * wordptr
Definition: myisamdef.h:361
uint
unsigned int uint
Definition: uca-dump.cc:29
MI_BASE_INFO::min_pack_length
ulong min_pack_length
Definition: myisamdef.h:138
MYISAM_SHARE::kfile
File kfile
Definition: myisamdef.h:215
BUFFPEK
Definition: myisamdef.h:329
MI_INFO::lock_type
int lock_type
Definition: myisamdef.h:300
TREE
Definition: my_tree.h:67
_mi_read_rnd_static_record
int _mi_read_rnd_static_record(MI_INFO *, uchar *, my_off_t, bool)
Definition: mi_statrec.cc:173
MI_BLOCK_INFO::data_len
ulong data_len
Definition: myisamdef.h:677
MI_SORT_PARAM::key_cmp
int(* key_cmp)(void *, uchar *, uchar *)
Definition: myisamdef.h:365
mi_key_memory_MI_INFO_ft1_to_ft2
PSI_memory_key mi_key_memory_MI_INFO_ft1_to_ft2
Definition: mi_static.cc:100
_mi_ft_update
int _mi_ft_update(MI_INFO *info, uint keynr, uchar *keybuf, const uchar *oldrec, const uchar *newrec, my_off_t pos)
Definition: ft_update.cc:185
MI_INFO::tmp_lock_type
int tmp_lock_type
Definition: myisamdef.h:301
MI_STATE_INFO::key_parts
uchar key_parts[2]
Definition: myisamdef.h:74
MI_STATE_INFO::state_length
uint state_length
Definition: myisamdef.h:111
MI_SORT_PARAM::keys
uint keys
Definition: myisamdef.h:353
MYISAM_SHARE::blobs
MI_BLOB * blobs
Definition: myisamdef.h:184
MI_STATUS_INFO::key_file_length
my_off_t key_file_length
Definition: myisamdef.h:60
MI_PACK::ref_length
uint ref_length
Definition: myisamdef.h:169
MI_STATE_INFO::language
uchar language
Definition: myisamdef.h:78
_mi_calc_bin_pack_key_length
int _mi_calc_bin_pack_key_length(MI_KEYDEF *keyinfo, uint nod_flag, const uchar *key_pos, uchar *org_key, uchar *prev_key, const uchar *key, MI_KEY_PARAM *s_temp)
Definition: mi_search.cc:1550
MI_SORT_PARAM::real_key_length
uint real_key_length
Definition: myisamdef.h:352
MI_BIT_BUFF::bits
uint bits
Definition: myisamdef.h:243
MI_INFO::last_loop
ulong last_loop
Definition: myisamdef.h:277
MI_SORT_PARAM::tempfile_for_exceptions
IO_CACHE tempfile_for_exceptions
Definition: myisamdef.h:339
MI_INFO::rtree_recursion_depth
int rtree_recursion_depth
Definition: myisamdef.h:326
MYISAM_SHARE::last_version
ulong last_version
Definition: myisamdef.h:207
MI_STATE_INFO::key_root
my_off_t * key_root
Definition: myisamdef.h:93
mi_key_memory_stPageList_pages
PSI_memory_key mi_key_memory_stPageList_pages
Definition: mi_static.cc:117
mi_check_status
bool mi_check_status(void *param)
Definition: mi_locking.cc:349
uchar
unsigned char uchar
Definition: my_inttypes.h:51
_mi_read_rnd_pack_record
int _mi_read_rnd_pack_record(MI_INFO *, uchar *, my_off_t, bool)
Definition: mi_packrec.cc:1165
mi_key_mutex_MI_CHECK_print_msg
PSI_mutex_key mi_key_mutex_MI_CHECK_print_msg
Definition: myisamdef.h:846
MI_STATUS_INFO::empty
my_off_t empty
Definition: myisamdef.h:58
_mi_fetch_keypage
uchar * _mi_fetch_keypage(MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t page, int level, uchar *buff, int return_buffer)
Definition: mi_page.cc:36
mi_alloc_rec_buff
uchar * mi_alloc_rec_buff(MI_INFO *, ulong, uchar **)
Definition: mi_open.cc:658
MI_BASE_INFO::max_pack_length
ulong max_pack_length
Definition: myisamdef.h:139
_mi_kpos
my_off_t _mi_kpos(uint nod_flag, uchar *after_key)
Definition: mi_search.cc:514
_mi_store_var_pack_key
void _mi_store_var_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos, MI_KEY_PARAM *s_temp)
Definition: mi_search.cc:1642
MI_INFO
Definition: myisamdef.h:250
MI_BASE_INFO::max_data_file_length
my_off_t max_data_file_length
Definition: myisamdef.h:131
BUFFPEK::base
uchar * base
Definition: myisamdef.h:331
rules_table_service::end
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:188
MYISAM_SHARE::unique_file_name
char * unique_file_name
Definition: myisamdef.h:186
command
command
Definition: version_token.cc:278
myisam_open_list
LIST * myisam_open_list
Definition: mi_static.cc:40
my_thread_handle
Definition: my_thread_bits.h:51
_mi_enlarge_root
int _mi_enlarge_root(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, my_off_t *root)
Definition: mi_write.cc:262
mi_restore_status
void mi_restore_status(void *param)
Definition: mi_locking.cc:318
MYISAM_SHARE::write_flag
myf write_flag
Definition: myisamdef.h:221
mi_mmap_pwrite
size_t mi_mmap_pwrite(MI_INFO *info, const uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags)
Definition: mi_dynrec.cc:214
_mi_write_keypage
int _mi_write_keypage(MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t page, int level, uchar *buff)
Definition: mi_page.cc:72
myisam_quick_table_bits
uint myisam_quick_table_bits
Definition: mi_static.cc:55
MYISAM_SHARE::max_pack_length
ulong max_pack_length
Definition: myisamdef.h:210
my_pointer_arithmetic.h
MI_INFO::last_key_func
enum ha_rkey_function last_key_func
Definition: myisamdef.h:295
LIST
Definition: my_list.h:35
st_keycache_thread_var
Definition: keycache.h:47
MYISAM_SHARE::blocksize
uint blocksize
Definition: myisamdef.h:220
uint32
uint32_t uint32
Definition: my_inttypes.h:66
MI_STATE_INFO::split
ha_rows split
Definition: myisamdef.h:85
MYISAM_SHARE::data_file_type
enum data_file_type data_file_type
Definition: myisamdef.h:222
MI_UNIQUEDEF
Definition: myisam.h:203
_mi_rec_pack
uint _mi_rec_pack(MI_INFO *info, uchar *to, const uchar *from)
Definition: mi_dynrec.cc:854
myisam.h
MI_BIT_BUFF::current_byte
mi_bit_type current_byte
Definition: myisamdef.h:242
MI_STATE_INFO::state
MI_STATUS_INFO state
Definition: myisamdef.h:84
MI_STATE_INFO::not_used
uchar not_used
Definition: myisamdef.h:81
consts::FILE
const std::string FILE("FILE")
_myisam_log_record
void _myisam_log_record(enum myisam_log_commands command, MI_INFO *info, const uchar *record, my_off_t filepos, int result)
Definition: mi_log.cc:115
MI_STATE_INFO::max_block_size_index
uchar max_block_size_index
Definition: myisamdef.h:79
_mi_cmp_dynamic_unique
int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def, const uchar *record, my_off_t pos)
Definition: mi_dynrec.cc:1327
mi_key_mutex_MI_SORT_INFO_mutex
PSI_mutex_key mi_key_mutex_MI_SORT_INFO_mutex
Definition: myisamdef.h:846
MI_STATE_INFO::auto_increment
ulonglong auto_increment
Definition: myisamdef.h:87
MI_BASE_INFO::pack_reclength
ulong pack_reclength
Definition: myisamdef.h:137
MI_COLUMNDEF
Definition: myisam.h:226
mi_disable_indexes
int mi_disable_indexes(MI_INFO *info)
Definition: mi_open.cc:1280
BUFFPEK::mem_count
ulong mem_count
Definition: myisamdef.h:333
MI_BASE_INFO::pack_bits
uint pack_bits
Definition: myisamdef.h:148
MI_STATE_INFO::update_count
ulong update_count
Definition: myisamdef.h:90
_mi_get_pack_key
uint _mi_get_pack_key(MI_KEYDEF *keyinfo, uint nod_flag, uchar **page, uchar *key)
Definition: mi_search.cc:712
calc_pack_length
uint calc_pack_length(uint version, ulong length)
Definition: mi_packrec.cc:1506
MYISAM_SHARE::base
MI_BASE_INFO base
Definition: myisamdef.h:177
MI_BASE_INFO::key_parts
uint key_parts
Definition: myisamdef.h:155
MI_KEY_PARAM
Definition: myisamdef.h:520
MI_LOG_EXTRA
@ MI_LOG_EXTRA
Definition: myisamdef.h:721
_mi_prefix_search
int _mi_prefix_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint key_len, uint comp_flag, uchar **ret_pos, uchar *buff, bool *was_last_key)
Definition: mi_search.cc:277
MYISAM_SHARE
Definition: myisamdef.h:175
MI_INFO::dfile
int dfile
Definition: myisamdef.h:289
bool
#define bool
Definition: config_static.h:42
mi_key_memory_FTB
PSI_memory_key mi_key_memory_FTB
Definition: mi_static.cc:103
MI_INFO::filename
char * filename
Definition: myisamdef.h:261
mi_keyseg_write
int mi_keyseg_write(File file, const HA_KEYSEG *keyseg)
Definition: mi_open.cc:1116
name
const string name("\"Name\"")
MI_INFO::rec_cache
IO_CACHE rec_cache
Definition: myisamdef.h:306
_myisam_log
void _myisam_log(enum myisam_log_commands command, MI_INFO *info, const uchar *buffert, uint length)
Definition: mi_log.cc:74
MI_STATUS_INFO::key_empty
my_off_t key_empty
Definition: myisamdef.h:59
MYISAM_SHARE::mode
int mode
Definition: myisamdef.h:217
MI_INFO::bit_buff
MI_BIT_BUFF bit_buff
Definition: myisamdef.h:254
MYISAM_SHARE::is_log_table
bool is_log_table
Definition: myisamdef.h:224
MI_INFO::pos
my_off_t pos
Definition: myisamdef.h:281
MI_BASE_INFO::fields
ulong fields
Definition: myisamdef.h:141
mi_key_memory_MI_INFO_bulk_insert
PSI_memory_key mi_key_memory_MI_INFO_bulk_insert
Definition: mi_static.cc:101
myisam_pack_file_magic
uchar myisam_pack_file_magic[]
Definition: myisamdef.h:512
MI_INFO::lastpos
my_off_t lastpos
Definition: myisamdef.h:278
mi_key_rwlock_MYISAM_SHARE_key_root_lock
PSI_rwlock_key mi_key_rwlock_MYISAM_SHARE_key_root_lock
Definition: mi_static.cc:134
MI_SORT_PARAM::write_key
int(* write_key)(MI_SORT_PARAM *, IO_CACHE *, uchar *, uint, uint)
Definition: myisamdef.h:370
MI_STATE_INFO::base_pos
uchar base_pos[2]
Definition: myisamdef.h:73
mi_keycache_thread_var_suspend
PSI_cond_key mi_keycache_thread_var_suspend
Definition: myisamdef.h:852
MYISAM_SHARE::write_record
int(* write_record)(MI_INFO *, const uchar *)
Definition: myisamdef.h:194
IO_CACHE
Definition: my_sys.h:337
mi_dynmap_file
bool mi_dynmap_file(MI_INFO *info, my_off_t size)
Definition: mi_dynrec.cc:78
MI_STATE_INFO::process
ulong process
Definition: myisamdef.h:88
_mi_write_blob_record
int _mi_write_blob_record(MI_INFO *, const uchar *)
Definition: mi_dynrec.cc:255
_mi_rec_unpack
ulong _mi_rec_unpack(MI_INFO *info, uchar *to, const uchar *from, ulong reclength)
Definition: mi_dynrec.cc:1045
MI_BLOB::offset
ulong offset
Definition: myisamdef.h:162
MI_SORT_PARAM::pos
my_off_t pos
Definition: myisamdef.h:351
mi_key_memory_record_buffer
PSI_memory_key mi_key_memory_record_buffer
Definition: mi_static.cc:102
uint8
uint8_t uint8
Definition: my_inttypes.h:62
mi_unique_comp
int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b, bool null_are_equal)
Definition: mi_unique.cc:142
MI_STATE_INFO::key_info
ulong * key_info
Definition: myisamdef.h:112
MI_INFO::index_cond_func_arg
void * index_cond_func_arg
Definition: myisamdef.h:320
MI_KEY_PARAM::key_length
uint key_length
Definition: myisamdef.h:521
mi_setup_functions
void mi_setup_functions(MYISAM_SHARE *share)
Definition: mi_open.cc:700
_mi_pack_rec_unpack
int _mi_pack_rec_unpack(MI_INFO *info, MI_BIT_BUFF *bit_buff, uchar *to, uchar *from, ulong reclength)
Definition: mi_packrec.cc:697
MYISAM_SHARE::r_locks
uint r_locks
Definition: myisamdef.h:219
MI_BIT_BUFF::blob_pos
uchar * blob_pos
Definition: myisamdef.h:244
MI_SORT_PARAM::key_length
uint key_length
Definition: myisamdef.h:352
reclength
static int reclength
Definition: hp_test2.cc:46
MI_INFO::save_lastinx
int save_lastinx
Definition: myisamdef.h:304
MI_INFO::buff
uchar * buff
Definition: myisamdef.h:262
MI_BASE_INFO::all_key_parts
uint all_key_parts
Definition: myisamdef.h:155
MI_STATE_INFO::check_time
time_t check_time
Definition: myisamdef.h:104
MYISAM_SHARE::ft2_keyinfo
MI_KEYDEF ft2_keyinfo
Definition: myisamdef.h:178
MI_KEY_PARAM::key
const uchar * key
Definition: myisamdef.h:523
MI_BASE_INFO::auto_key
uint auto_key
Definition: myisamdef.h:146
DYNAMIC_ARRAY
Definition: my_sys.h:300
MI_BLOCK_INFO::offset
uint offset
Definition: myisamdef.h:684
MI_PACK
Definition: myisamdef.h:167
MI_STATUS_INFO::records
ha_rows records
Definition: myisamdef.h:56
MYISAM_SHARE::ftkeys
uint32 ftkeys
Definition: myisamdef.h:214
_mi_move_key
uchar * _mi_move_key(MI_KEYDEF *keyinfo, uchar *to, const uchar *from)
Definition: mi_search.cc:1091
_mi_get_binary_pack_key
uint _mi_get_binary_pack_key(MI_KEYDEF *keyinfo, uint nod_flag, uchar **page_pos, uchar *key)
Definition: mi_search.cc:821
_mi_rec_pos
my_off_t _mi_rec_pos(MYISAM_SHARE *info, uchar *ptr)
Definition: mi_search.cc:606
mi_key_cond_MI_SORT_INFO_cond
PSI_cond_key mi_key_cond_MI_SORT_INFO_cond
Definition: mi_static.cc:145
MYISAM_SHARE::lock
THR_LOCK lock
Definition: myisamdef.h:230
BUFFPEK::max_keys
ulong max_keys
Definition: myisamdef.h:334
_mi_search
int _mi_search(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint key_len, uint nextflag, my_off_t pos)
Definition: mi_search.cc:76
MI_INFO::rnext_same_key
uchar * rnext_same_key
Definition: myisamdef.h:266
mi_key_thread_find_all_keys
PSI_thread_key mi_key_thread_find_all_keys
Definition: mi_static.cc:167
mi_keyseg_read
uchar * mi_keyseg_read(uchar *ptr, HA_KEYSEG *keyseg)
Definition: mi_open.cc:1140
MYISAM_SHARE::decode_trees
MI_DECODE_TREE * decode_trees
Definition: myisamdef.h:191
PSI_thread_key
unsigned int PSI_thread_key
Instrumented thread key.
Definition: psi_thread_bits.h:48
mi_check_print_error
void mi_check_print_error(MI_CHECK *param, const char *fmt,...)
Definition: ha_myisam.cc:571
_mi_write_static_record
int _mi_write_static_record(MI_INFO *, const uchar *)
Definition: mi_statrec.cc:34
_mi_get_block_info
uint _mi_get_block_info(MI_BLOCK_INFO *, File, my_off_t)
Definition: mi_dynrec.cc:1641
ha_rkey_function
ha_rkey_function
Definition: my_base.h:77
flush_blocks
int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file)
Definition: mi_check.cc:1739
_mi_find_half_pos
uchar * _mi_find_half_pos(uint nod_flag, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uint *return_key_length, uchar **after_key)
Definition: mi_write.cc:577
MI_STATE_INFO::status
ulong status
Definition: myisamdef.h:91
mi_key_mutex_MYISAM_SHARE_intern_lock
PSI_mutex_key mi_key_mutex_MYISAM_SHARE_intern_lock
Definition: mi_static.cc:121
MI_BIT_BUFF::blob_end
uchar * blob_end
Definition: myisamdef.h:244
MI_KEY_PARAM::prev_length
uint prev_length
Definition: myisamdef.h:522
_mi_cmp_static_unique
int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def, const uchar *record, my_off_t pos)
Definition: mi_statrec.cc:131
save_pack_length
uint save_pack_length(uint version, uchar *block_buff, ulong length)
Definition: mi_packrec.cc:1466
MI_INFO::lastkey2
uchar * lastkey2
Definition: myisamdef.h:263
THR_LOCK_DATA
Definition: thr_lock.h:123
MI_BLOCK_INFO::prev_filepos
my_off_t prev_filepos
Definition: myisamdef.h:682
gis::length
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
MI_KEY_PARAM::ref_length
uint ref_length
Definition: myisamdef.h:521
_mi_unmap_file
void _mi_unmap_file(MI_INFO *info)
Definition: mi_packrec.cc:1384
mi_report_error
void mi_report_error(int errcode, const char *file_name)
Definition: mi_info.cc:124
ICP_RESULT
enum icp_result ICP_RESULT
Values returned by index_cond_func_xxx functions.
mi_check_print_warning
void mi_check_print_warning(MI_CHECK *param, const char *fmt,...)
Definition: ha_myisam.cc:587
mi_nommap_pread
size_t mi_nommap_pread(MI_INFO *info, uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags)
Definition: mi_dynrec.cc:193
MI_INFO::lastinx
int lastinx
Definition: myisamdef.h:292
MI_INFO::this_loop
ulong this_loop
Definition: myisamdef.h:276
MI_SORT_PARAM::buffpek
DYNAMIC_ARRAY buffpek
Definition: myisamdef.h:340
mi_copy_status
void mi_copy_status(void *to, void *from)
Definition: mi_locking.cc:324
ulong
unsigned long ulong
Definition: my_inttypes.h:48
mi_key_file_kfile
PSI_file_key mi_key_file_kfile
Definition: myisamdef.h:854
MYISAM_SHARE::key_root_lock
mysql_rwlock_t * key_root_lock
Definition: myisamdef.h:232
MI_INFO::int_nod_flag
uint int_nod_flag
Definition: myisamdef.h:271
uint16
uint16_t uint16
Definition: my_inttypes.h:64
myf
int myf
Definition: my_inttypes.h:93
mi_key_memory_MI_SORT_PARAM
PSI_memory_key mi_key_memory_MI_SORT_PARAM
Definition: mi_static.cc:108
_mi_kpointer
void _mi_kpointer(MI_INFO *info, uchar *buff, my_off_t pos)
Definition: mi_search.cc:539
MI_INFO::save_lastkey_length
uint save_lastkey_length
Definition: myisamdef.h:296
ulonglong
unsigned long long int ulonglong
Definition: my_inttypes.h:55
MYISAM_SHARE::read_rnd
int(* read_rnd)(MI_INFO *, uchar *, my_off_t, bool)
Definition: myisamdef.h:197
MI_CHECK
Definition: myisam.h:342
MYISAM_SHARE::file_map
uchar * file_map
Definition: myisamdef.h:189
mi_state_info_write
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
Definition: mi_open.cc:793
thr_lock.h
MI_STATE_INFO::unique_key_parts
uchar unique_key_parts[2]
Definition: myisamdef.h:75
MI_STATE_INFO::dellink
my_off_t dellink
Definition: myisamdef.h:86
MI_BASE_INFO::reloc
ha_rows reloc
Definition: myisamdef.h:134
ha_rows
my_off_t ha_rows
Definition: my_base.h:1132
MI_BASE_INFO::key_reflength
uint key_reflength
Definition: myisamdef.h:144
MI_STATE_INFO::open_count
uint open_count
Definition: myisamdef.h:106
MI_STATE_INFO::sortkey
uint sortkey
Definition: myisamdef.h:105
mi_unique_hash
ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *buf)
Definition: mi_unique.cc:83
_mi_search_first
int _mi_search_first(MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos)
Definition: mi_search.cc:1175
_mi_read_pack_record
int _mi_read_pack_record(MI_INFO *info, my_off_t filepos, uchar *buf)
Definition: mi_packrec.cc:674
MYISAM_SHARE::delay_key_write
bool delay_key_write
Definition: myisamdef.h:228
MI_STATE_INFO::unique
ulong unique
Definition: myisamdef.h:89
mi_key_file_log
PSI_file_key mi_key_file_log
Definition: myisamdef.h:855
MI_STATE_INFO::checksum
ha_checksum checksum
Definition: myisamdef.h:100
MI_DECODE_TREE
Definition: myisam.h:211
_mi_get_key
uchar * _mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uchar *keypos, uint *return_key_length)
Definition: mi_search.cc:951
PSI_rwlock_key
unsigned int PSI_rwlock_key
Instrumented rwlock key.
Definition: psi_rwlock_bits.h:41
MI_INFO::blob_length
ulong blob_length
Definition: myisamdef.h:288
MI_INFO::page_changed
bool page_changed
Definition: myisamdef.h:312
key_memory_QUEUE
PSI_memory_key key_memory_QUEUE
Definition: mi_static.cc:119
MI_STATE_INFO::sec_index_changed
ulong sec_index_changed
Definition: myisamdef.h:97
mi_uniquedef_write
uint mi_uniquedef_write(File file, MI_UNIQUEDEF *keydef)
Definition: mi_open.cc:1171
MI_INFO::last_unique
ulong last_unique
Definition: myisamdef.h:275
keycache_tls
thread_local st_keycache_thread_var * keycache_tls
Definition: mi_static.cc:67
_mi_store_static_key
void _mi_store_static_key(MI_KEYDEF *keyinfo, uchar *key_pos, MI_KEY_PARAM *s_temp)
Definition: mi_search.cc:1625
MYISAM_SHARE::tot_locks
uint tot_locks
Definition: myisamdef.h:219
MYISAM_SHARE::compare_unique
int(* compare_unique)(MI_INFO *, MI_UNIQUEDEF *, const uchar *record, my_off_t pos)
Definition: myisamdef.h:201
MYISAM_SHARE::file_write
size_t(* file_write)(MI_INFO *, const uchar *, size_t, my_off_t, myf)
Definition: myisamdef.h:204
MI_MAX_KEY_SEG
#define MI_MAX_KEY_SEG
Definition: myisam.h:63
MI_SORT_PARAM::max_pos
my_off_t max_pos
Definition: myisamdef.h:351
MI_BASE_INFO::max_key_file_length
my_off_t max_key_file_length
Definition: myisamdef.h:132
where
static char * where
Definition: mysqldump.cc:132
MI_KEY_PARAM::part_of_prev_key
uint part_of_prev_key
Definition: myisamdef.h:522
MI_BIT_BUFF::pos
uchar * pos
Definition: myisamdef.h:244
MI_BLOCK_INFO::filepos
my_off_t filepos
Definition: myisamdef.h:680
THR_LOCK
Definition: thr_lock.h:138
MI_BASE_INFO::max_key_block_length
uint max_key_block_length
Definition: myisamdef.h:149
mi_uniquedef_read
uchar * mi_uniquedef_read(uchar *ptr, MI_UNIQUEDEF *keydef)
Definition: mi_open.cc:1183
MYISAM_SHARE::state
MI_STATE_INFO state
Definition: myisamdef.h:176
_mi_read_rnd_dynamic_record
int _mi_read_rnd_dynamic_record(MI_INFO *, uchar *, my_off_t, bool)
Definition: mi_dynrec.cc:1480
MYISAM_SHARE::calc_checksum
ha_checksum(* calc_checksum)(MI_INFO *, const uchar *)
Definition: myisamdef.h:200
MI_BLOB
Definition: myisamdef.h:160
MI_STATE_INFO::header_length
uchar header_length[2]
Definition: myisamdef.h:70
MYISAM_SHARE::file_read
size_t(* file_read)(MI_INFO *, uchar *, size_t, my_off_t, myf)
Definition: myisamdef.h:203
MI_INFO::append_insert_at_end
bool append_insert_at_end
Definition: myisamdef.h:310
check_table_is_closed
bool check_table_is_closed(const char *name, const char *where)
MI_KEY_PARAM::next_key_pos
uchar * next_key_pos
Definition: myisamdef.h:524
_mi_decrement_open_count
int _mi_decrement_open_count(MI_INFO *info)
Definition: mi_locking.cc:500
MI_SORT_PARAM::seg
HA_KEYSEG * seg
Definition: myisamdef.h:357
MI_INFO::nextpos
my_off_t nextpos
Definition: myisamdef.h:279
MI_BLOB::pack_length
uint pack_length
Definition: myisamdef.h:163
MI_INFO::s
MYISAM_SHARE * s
Definition: myisamdef.h:251
_mi_calc_static_key_length
int _mi_calc_static_key_length(MI_KEYDEF *keyinfo, uint nod_flag, const uchar *key_pos, uchar *org_key, uchar *key_buff, const uchar *key, MI_KEY_PARAM *s_temp)
Definition: mi_search.cc:1264
info
Log info(cout, "NOTE")
MI_SORT_PARAM
Definition: myisamdef.h:337
MYISAM_SHARE::data_file
File data_file
Definition: myisamdef.h:216
MI_STATE_INFO
Definition: myisamdef.h:66
MI_BASE_INFO::reclength
ulong reclength
Definition: myisamdef.h:136
MI_BASE_INFO::extra_alloc_bytes
uint extra_alloc_bytes
Definition: myisamdef.h:152
MYISAM_SHARE::reopen
uint reopen
Definition: myisamdef.h:218
MYISAM_SHARE::concurrent_insert
bool concurrent_insert
Definition: myisamdef.h:228
MI_STATUS_INFO::data_file_length
my_off_t data_file_length
Definition: myisamdef.h:61
MI_INFO::ftparser_param
MYSQL_FTPARSER_PARAM * ftparser_param
Definition: myisamdef.h:259
key_length
static uint key_length
Definition: mi_test1.cc:42
flag
static int flag
Definition: hp_test1.cc:39
sort_write_record
int sort_write_record(MI_SORT_PARAM *sort_param)
Definition: mi_check.cc:3297
MI_STATE_INFO::sec_index_used
ulong sec_index_used
Definition: myisamdef.h:98
MYISAM_SHARE::rec
MI_COLUMNDEF * rec
Definition: myisamdef.h:182
MYISAM_SHARE::read_record
int(* read_record)(MI_INFO *, my_off_t, uchar *)
Definition: myisamdef.h:193
MI_INFO::read_record
int(* read_record)(MI_INFO *, my_off_t, uchar *)
Definition: myisamdef.h:273
MI_BASE_INFO::mean_row_length
ulong mean_row_length
Definition: myisamdef.h:135
filename
const char * filename
Definition: pfs_example_component_population.cc:64
MI_STATUS_INFO
Definition: myisamdef.h:55
BUFFPEK::key
uchar * key
Definition: myisamdef.h:331
MI_INFO::checksum
ha_checksum checksum
Definition: myisamdef.h:285
MYISAM_SHARE::unique_name_length
uint unique_name_length
Definition: myisamdef.h:213
_mi_read_pack_info
bool _mi_read_pack_info(MI_INFO *info, bool fix_keys)
Definition: mi_packrec.cc:151