MySQL  8.0.18
Source Code Documentation
myisam.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 /**
25  @file include/myisam.h
26  This file should be included when using myisam functions.
27 */
28 
29 #ifndef _myisam_h
30 #define _myisam_h
31 
32 #include "my_config.h"
33 
34 #include <sys/types.h>
35 #include <time.h>
36 
37 #include "keycache.h"
38 #include "m_ctype.h"
39 #include "m_string.h"
40 #include "my_base.h"
41 #include "my_check_opt.h"
42 #include "my_compare.h"
43 #include "my_inttypes.h"
44 #include "my_io.h"
45 #include "my_macros.h"
46 
47 /*
48  Limit max keys according to HA_MAX_POSSIBLE_KEY
49 */
50 
51 #if MAX_INDEXES > HA_MAX_POSSIBLE_KEY
52 #define MI_MAX_KEY HA_MAX_POSSIBLE_KEY /* Max allowed keys */
53 #else
54 #define MI_MAX_KEY MAX_INDEXES /* Max allowed keys */
55 #endif
56 
57 #define MI_MAX_POSSIBLE_KEY_BUFF HA_MAX_POSSIBLE_KEY_BUFF
58 /*
59  The following defines can be increased if necessary.
60  But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH.
61 */
62 #define MI_MAX_KEY_LENGTH 1000 /* Max length in bytes */
63 #define MI_MAX_KEY_SEG 16 /* Max segments for key */
64 
65 #define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH + MI_MAX_KEY_SEG * 6 + 8 + 8)
66 #define MI_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */
67 #define MI_NAME_IEXT ".MYI"
68 #define MI_NAME_DEXT ".MYD"
69 
70 /* Possible values for myisam_block_size (must be power of 2) */
71 #define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */
72 #define MI_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */
73 #define MI_MAX_KEY_BLOCK_LENGTH 16384
74 
75 /*
76  In the following macros '_keyno_' is 0 .. keys-1.
77  If there can be more keys than bits in the key_map, the highest bit
78  is for all upper keys. They cannot be switched individually.
79  This means that clearing of high keys is ignored, setting one high key
80  sets all high keys.
81 */
82 #define MI_KEYMAP_BITS (8 * SIZEOF_LONG_LONG)
83 #define MI_KEYMAP_HIGH_MASK (1ULL << (MI_KEYMAP_BITS - 1))
84 #define mi_get_mask_all_keys_active(_keys_) \
85  (((_keys_) < MI_KEYMAP_BITS) ? ((1ULL << (_keys_)) - 1ULL) : (~0ULL))
86 
87 #if MI_MAX_KEY > MI_KEYMAP_BITS
88 
89 #define mi_is_key_active(_keymap_, _keyno_) \
90  (((_keyno_) < MI_KEYMAP_BITS) ? MY_TEST((_keymap_) & (1ULL << (_keyno_))) \
91  : MY_TEST((_keymap_)&MI_KEYMAP_HIGH_MASK))
92 #define mi_set_key_active(_keymap_, _keyno_) \
93  (_keymap_) |= (((_keyno_) < MI_KEYMAP_BITS) ? (1ULL << (_keyno_)) \
94  : MI_KEYMAP_HIGH_MASK)
95 #define mi_clear_key_active(_keymap_, _keyno_) \
96  (_keymap_) &= (((_keyno_) < MI_KEYMAP_BITS) ? (~(1ULL << (_keyno_))) \
97  : (~(0ULL)) /*ignore*/)
98 
99 #else
100 
101 #define mi_is_key_active(_keymap_, _keyno_) \
102  MY_TEST((_keymap_) & (1ULL << (_keyno_)))
103 #define mi_set_key_active(_keymap_, _keyno_) (_keymap_) |= (1ULL << (_keyno_))
104 #define mi_clear_key_active(_keymap_, _keyno_) \
105  (_keymap_) &= (~(1ULL << (_keyno_)))
106 
107 #endif
108 
109 #define mi_is_any_key_active(_keymap_) MY_TEST((_keymap_))
110 #define mi_is_all_keys_active(_keymap_, _keys_) \
111  ((_keymap_) == mi_get_mask_all_keys_active(_keys_))
112 #define mi_set_all_keys_active(_keymap_, _keys_) \
113  (_keymap_) = mi_get_mask_all_keys_active(_keys_)
114 #define mi_clear_all_keys_active(_keymap_) (_keymap_) = 0
115 #define mi_intersect_keys_active(_to_, _from_) (_to_) &= (_from_)
116 #define mi_is_any_intersect_keys_active(_keymap1_, _keys_, _keymap2_) \
117  ((_keymap1_) & (_keymap2_)&mi_get_mask_all_keys_active(_keys_))
118 #define mi_copy_keys_active(_to_, _maxkeys_, _from_) \
119  (_to_) = (mi_get_mask_all_keys_active(_maxkeys_) & (_from_))
120 
121 /* Param to/from mi_status */
122 
123 struct MI_ISAMINFO /* Struct from h_info */
124 {
125  ha_rows records; /* Records in database */
126  ha_rows deleted; /* Deleted records in database */
127  my_off_t recpos; /* Pos for last used record */
128  my_off_t newrecpos; /* Pos if we write new record */
129  my_off_t dupp_key_pos; /* Position to record with dupp key */
130  my_off_t data_file_length, /* Length of data file */
133  ulong reclength; /* Recordlength */
134  ulong mean_reclength; /* Mean recordlength (if packed) */
136  ulonglong key_map; /* Which keys are used */
138  uint keys; /* Number of keys in use */
139  uint options; /* HA_OPTION_... used */
140  int errkey, /* With key was dupplicated on err */
141  sortkey; /* clustered by this key */
142  File filenr; /* (uniq) filenr for datafile */
143  time_t create_time; /* When table was created */
144  time_t check_time;
145  time_t update_time;
148  ulong *rec_per_key; /* for sql optimizing */
149 };
150 
152  const char *index_file_name, *data_file_name; /* If using symlinks */
161 };
162 
163 struct MI_INFO; /* For referense */
164 struct MYISAM_SHARE;
165 struct MI_INFO;
166 struct MI_KEY_PARAM;
167 
168 struct MI_KEYDEF /* Key definition with open & info */
169 {
170  MYISAM_SHARE *share; /* Pointer to base (set in mi_open) */
171  uint16 keysegs; /* Number of key-segment */
172  uint16 flag; /* NOSAME, PACK_USED */
173 
174  uint8 key_alg; /* BTREE, RTREE */
175  uint16 block_length; /* Length of keyblock (auto) */
176  uint16 underflow_block_length; /* When to execute underflow */
177  uint16 keylength; /* Tot length of keyparts (auto) */
178  uint16 minlength; /* min length of (packed) key (auto) */
179  uint16 maxlength; /* max length of (packed) key (auto) */
180  uint16 block_size_index; /* block_size (auto) */
181  uint32 version; /* For concurrent read/write */
182  uint32 ftkey_nr; /* full-text index number */
183 
185  struct st_mysql_ftparser *parser; /* Fulltext [pre]parser */
187  uint key_len, uint comp_flag, uchar **ret_pos, uchar *buff,
188  bool *was_last_key);
190  int (*pack_key)(MI_KEYDEF *keyinfo, uint nod_flag, const uchar *next_key,
191  uchar *org_key, uchar *prev_key, const uchar *key,
192  MI_KEY_PARAM *s_temp);
193  void (*store_key)(MI_KEYDEF *keyinfo, uchar *key_pos, MI_KEY_PARAM *s_temp);
194  int (*ck_insert)(MI_INFO *inf, uint k_nr, uchar *k, uint klen);
195  int (*ck_delete)(MI_INFO *inf, uint k_nr, uchar *k, uint klen);
196 };
197 
198 #define MI_UNIQUE_HASH_LENGTH 4
199 
200 struct MI_UNIQUEDEF /* Segment definition of unique */
201 {
202  uint16 keysegs; /* Number of key-segment */
203  uchar key; /* Mapped to which key */
206 };
207 
208 struct MI_DECODE_TREE /* Decode huff-table */
209 {
213 };
214 
215 struct MI_BIT_BUFF;
216 
217 /*
218  Note that null markers should always be first in a row !
219  When creating a column, one should only specify:
220  type, length, null_bit and null_pos
221 */
222 
223 struct MI_COLUMNDEF /* column information */
224 {
225  int16 type; /* en_fieldtype */
226  uint16 length; /* length of field */
227  uint32 offset; /* Offset to position in row */
228  uint8 null_bit; /* If column may be 0 */
229  uint16 null_pos; /* position for null marker */
230 
231  void (*unpack)(MI_COLUMNDEF *rec, MI_BIT_BUFF *buff, uchar *start,
232  uchar *end);
236 };
237 
238 extern const char *myisam_log_filename; /* Name of logfile */
239 extern ulong myisam_block_size;
244 
245 /* usually used to check if a symlink points into the mysql data home */
246 /* which is normally forbidden */
247 extern int (*myisam_test_invalid_symlink)(const char *filename);
250 
251 /* Prototypes for myisam-functions */
252 
253 extern int mi_close_share(MI_INFO *file, bool *closed_share);
254 #define mi_close(file) mi_close_share(file, NULL)
255 extern int mi_delete(MI_INFO *file, const uchar *buff);
256 extern MI_INFO *mi_open_share(const char *name, MYISAM_SHARE *old_share,
257  int mode, uint wait_if_locked);
258 #define mi_open(name, mode, wait_if_locked) \
259  mi_open_share(name, NULL, mode, wait_if_locked)
260 extern int mi_panic(enum ha_panic_function function);
261 extern int mi_rfirst(MI_INFO *file, uchar *buf, int inx);
262 extern int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key,
263  key_part_map keypart_map, enum ha_rkey_function search_flag);
264 extern int mi_rlast(MI_INFO *file, uchar *buf, int inx);
265 extern int mi_rnext(MI_INFO *file, uchar *buf, int inx);
266 extern int mi_rnext_same(MI_INFO *info, uchar *buf);
267 extern int mi_rprev(MI_INFO *file, uchar *buf, int inx);
268 extern int mi_rrnd(MI_INFO *file, uchar *buf, my_off_t pos);
269 extern int mi_scan_init(MI_INFO *file);
270 extern int mi_scan(MI_INFO *file, uchar *buf);
271 extern int mi_rsame(MI_INFO *file, uchar *record, int inx);
272 extern int mi_rsame_with_pos(MI_INFO *file, uchar *record, int inx,
273  my_off_t pos);
274 extern int mi_update(MI_INFO *file, const uchar *old, uchar *new_record);
275 extern int mi_write(MI_INFO *file, uchar *buff);
276 extern my_off_t mi_position(MI_INFO *file);
277 extern int mi_status(MI_INFO *info, MI_ISAMINFO *x, uint flag);
278 extern int mi_lock_database(MI_INFO *file, int lock_type);
279 extern int mi_create(const char *name, uint keys, MI_KEYDEF *keydef,
280  uint columns, MI_COLUMNDEF *columndef, uint uniques,
281  MI_UNIQUEDEF *uniquedef, MI_CREATE_INFO *create_info,
282  uint flags);
283 extern int mi_delete_table(const char *name);
284 extern int mi_rename(const char *from, const char *to);
285 extern int mi_extra(MI_INFO *file, enum ha_extra_function function,
286  void *extra_arg);
287 extern int mi_reset(MI_INFO *file);
288 extern ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key,
289  key_range *max_key);
290 extern int mi_log(int activate_log);
291 extern int mi_is_changed(MI_INFO *info);
292 extern int mi_delete_all_rows(MI_INFO *info);
294 extern uint mi_get_pointer_length(ulonglong file_length, uint def);
295 
296 #define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for mmap file */
297 /* this is used to pass to mysql_myisamchk_table */
298 
299 #define MYISAMCHK_REPAIR 1 /* equivalent to myisamchk -r */
300 #define MYISAMCHK_VERIFY 2 /* Verify, run repair if failure */
301 
302 /*
303  Flags used by myisamchk.c or/and ha_myisam.cc that are NOT passed
304  to mi_check.c follows:
305 */
306 
307 #define TT_USEFRM 1
308 #define TT_FOR_UPGRADE 2
309 
310 #define O_NEW_INDEX 1 /* Bits set in out_flag */
311 #define O_NEW_DATA 2
312 #define O_DATA_LOST 4
313 
314 /* these struct is used by my_check to tell it what to do */
315 
316 struct SORT_KEY_BLOCKS /* Used when sorting */
317 {
321  int inited;
322 };
323 
324 /*
325  MyISAM supports several statistics collection methods. Currently statistics
326  collection method is not stored in MyISAM file and has to be specified for
327  each table analyze/repair operation in MI_CHECK::stats_method.
328 */
329 
330 typedef enum {
331  /* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */
333  /* Treat NULLs as equal when collecting statistics (like 4.0 did) */
335  /* Ignore NULLs - count only tuples without NULLs in the index components */
338 
339 struct MI_CHECK {
357  bool retry_repair{false}, force_sort{false};
359  MY_TMPDIR *tmpdir{nullptr};
363 
364  /*
365  The next two are used to collect statistics, see update_key_parts for
366  description.
367  */
370 
373  void *thd{nullptr};
374  const char *db_name{nullptr}, *table_name{nullptr};
375  const char *op_name{nullptr};
378  bool need_print_msg_lock{false};
379 };
380 
381 struct SORT_FT_BUF {
383  int count;
385 };
386 
387 struct SORT_INFO {
393  MI_INFO *info{nullptr};
394  MI_CHECK *param{nullptr};
395  uchar *buff{nullptr};
397  SORT_FT_BUF *ft_buf{nullptr};
398  /* sync things */
402 };
403 
404 /* functions in mi_check */
405 void myisamchk_init(MI_CHECK *param);
406 int chk_status(MI_CHECK *param, MI_INFO *info);
407 int chk_del(MI_CHECK *param, MI_INFO *info, uint test_flag);
408 int chk_size(MI_CHECK *param, MI_INFO *info);
409 int chk_key(MI_CHECK *param, MI_INFO *info);
410 int chk_data_link(MI_CHECK *param, MI_INFO *info, int extend);
411 int mi_repair(MI_CHECK *param, MI_INFO *info, char *name, int rep_quick,
412  bool no_copy_stat);
413 int mi_sort_index(MI_CHECK *param, MI_INFO *info, char *name,
414  bool no_copy_stat);
415 int mi_repair_by_sort(MI_CHECK *param, MI_INFO *info, const char *name,
416  int rep_quick, bool no_copy_stat);
417 int mi_repair_parallel(MI_CHECK *param, MI_INFO *info, const char *name,
418  int rep_quick, bool no_copy_stat);
419 int change_to_newfile(const char *filename, const char *old_ext,
420  const char *new_ext, myf myflags);
421 int lock_file(MI_CHECK *param, File file, int lock_type, const char *filetype,
422  const char *filename);
423 void lock_memory(MI_CHECK *param);
424 void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, bool repair);
426 void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
427  ulonglong *unique, ulonglong *notnull, ulonglong records);
428 int filecopy(MI_CHECK *param, File to, File from, my_off_t start,
429  my_off_t length, const char *type);
430 int movepoint(MI_INFO *info, uchar *record, my_off_t oldpos, my_off_t newpos,
431  uint prot_key);
432 int write_data_suffix(SORT_INFO *sort_info, bool fix_datafile);
434 int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename);
436 bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map,
437  bool force);
438 
443  KEY_CACHE *key_cache);
444 void mi_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache);
445 int mi_preload(MI_INFO *info, ulonglong key_map, bool ignore_leaves);
446 
449 #endif
#define MI_MAX_KEY_SEG
Definition: myisam.h:63
enum_mi_stats_method stats_method
Definition: myisam.h:376
bool myisam_delay_key_write
Definition: mi_static.cc:57
ulong myisam_block_size
Definition: mi_static.cc:56
int count
Definition: myisam.h:383
Some common macros.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
uint last_length
Definition: myisam.h:320
int lock_file(MI_CHECK *param, File file, int lock_type, const char *filetype, const char *filename)
Definition: mi_check.cc:1948
int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
Definition: mi_check.cc:3801
ulonglong auto_increment
Definition: myisam.h:135
my_off_t dupp_key_pos
Definition: myisam.h:129
unsigned char uchar
Definition: my_inttypes.h:51
int mi_scan_init(MI_INFO *file)
Definition: mi_scan.cc:29
int16 type
Definition: myisam.h:225
#define MY_WAIT_IF_FULL
Definition: my_sys.h:117
uint32 version
Definition: myisam.h:181
uint16 block_size_index
Definition: myisam.h:180
en_fieldtype
Definition: my_base.h:1045
int mi_status(MI_INFO *info, MI_ISAMINFO *x, uint flag)
Definition: mi_info.cc:43
myf myf_rw
Definition: myisam.h:361
uint32 offset
Definition: myisam.h:227
void mi_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache)
Definition: mi_keycache.cc:143
uint16 language
Definition: myisam.h:159
#define MY_WME
Definition: my_sys.h:116
ha_rows records
Definition: myisam.h:125
ha_rows deleted
Definition: myisam.h:126
HA_KEYSEG * seg
Definition: myisam.h:205
const string name("\ame\)
int mi_rename(const char *from, const char *to)
Definition: mi_rename.cc:33
Definition: keycache.h:70
int mi_sort_index(MI_CHECK *param, MI_INFO *info, char *name, bool no_copy_stat)
Definition: mi_check.cc:1747
int mi_extra(MI_INFO *file, enum ha_extra_function function, void *extra_arg)
Definition: mi_extra.cc:53
Definition: mi_test3.cc:54
ulong mean_reclength
Definition: myisam.h:134
int mi_delete_table(const char *name)
Definition: mi_delete_table.cc:34
int mi_rrnd(MI_INFO *file, uchar *buf, my_off_t pos)
Definition: mi_rrnd.cc:40
char * data_file_name
Definition: myisam.h:137
An instrumented cond structure.
Definition: mysql_cond_bits.h:49
int mi_log(int activate_log)
Definition: mi_log.cc:49
ulong key_part_map
Definition: my_base.h:998
Definition: my_sys.h:331
my_off_t keydata
Definition: myisam.h:347
Include file for Sun RPC to compile out of the box.
int mi_repair_by_sort(MI_CHECK *param, MI_INFO *info, const char *name, int rep_quick, bool no_copy_stat)
Definition: mi_check.cc:2013
Some integer typedefs for easier portability.
uint old_options
Definition: myisam.h:158
int mi_repair(MI_CHECK *param, MI_INFO *info, char *name, int rep_quick, bool no_copy_stat)
Definition: mi_check.cc:1404
const char * myisam_log_filename
Definition: mi_static.cc:53
const char * index_file_name
Definition: myisam.h:152
IO_CACHE read_cache
Definition: myisam.h:362
Definition: myisam.h:200
my_off_t new_file_pos
Definition: myisam.h:346
int mi_rsame_with_pos(MI_INFO *file, uchar *record, int inx, my_off_t pos)
Definition: mi_rsamepos.cc:40
uint total_keys
Definition: myisam.h:390
void lock_memory(MI_CHECK *param)
ulong write_buffer_length
Definition: myisam.h:351
int mi_scan(MI_INFO *file, uchar *buf)
Definition: mi_scan.cc:47
uchar * buf
Definition: myisam.h:382
char * index_file_name
Definition: myisam.h:137
ulonglong max_data_file_length
Definition: myisam.h:341
ulonglong data_file_length
Definition: myisam.h:156
MI_INFO * mi_open_share(const char *name, MYISAM_SHARE *old_share, int mode, uint wait_if_locked)
Definition: mi_open.cc:98
ulong reclength
Definition: myisam.h:133
int mi_reset(MI_INFO *file)
Definition: mi_extra.cc:236
SORT_KEY_BLOCKS * key_block_end
Definition: myisam.h:396
SORT_FT_BUF * ft_buf
Definition: myisam.h:397
uint16 language
Definition: myisam.h:355
uint mi_get_pointer_length(ulonglong file_length, uint def)
Definition: mi_create.cc:773
int(* pack_key)(MI_KEYDEF *keyinfo, uint nod_flag, const uchar *next_key, uchar *org_key, uchar *prev_key, const uchar *key, MI_KEY_PARAM *s_temp)
Definition: myisam.h:190
ulonglong notnull_count[MI_MAX_KEY_SEG+1]
Definition: myisam.h:369
int mi_rnext(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rnext.cc:37
ha_rows reloc_rows
Definition: myisam.h:154
uint16 minlength
Definition: myisam.h:178
int chk_del(MI_CHECK *param, MI_INFO *info, uint test_flag)
Definition: mi_check.cc:155
Definition: keycache.h:47
void myisamchk_init(MI_CHECK *param)
Definition: mi_check.cc:108
ha_rows total_deleted
Definition: myisam.h:348
int chk_data_link(MI_CHECK *param, MI_INFO *info, int extend)
Definition: mi_check.cc:886
ulong * rec_per_key
Definition: myisam.h:148
ulonglong max_record_length
Definition: myisam.h:343
void mi_flush_bulk_insert(MI_INFO *info, uint inx)
Definition: mi_write.cc:913
Definition: myisam.h:223
ha_rkey_function
Definition: my_base.h:77
Definition: myisamdef.h:175
Definition: myisam.h:123
uint32 ha_checksum
Definition: my_sys.h:561
ulong myisam_concurrent_insert
Definition: mi_static.cc:59
int mi_is_changed(MI_INFO *info)
Definition: mi_changed.cc:30
bool opt_follow_links
Definition: myisam.h:356
my_off_t delete_length
Definition: myisam.h:130
int mi_rnext_same(MI_INFO *info, uchar *buf)
Definition: mi_rnext_same.cc:38
HA_KEYSEG * end
Definition: myisam.h:184
const char * data_file_name
Definition: myisam.h:152
ha_checksum record_checksum
Definition: myisam.h:349
ha_panic_function
Definition: my_base.h:431
st_keycache_thread_var main_thread_keycache_var
Definition: mi_static.cc:64
bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map, bool force)
Definition: mi_check.cc:4231
ulong record_offset
Definition: myisam.h:147
ulong _mi_calc_blob_length(uint length, const uchar *pos)
Definition: mi_dynrec.cc:1163
static uint64_t cache_size
Definition: xcom_cache.c:389
ha_rows max_records
Definition: myisam.h:389
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part, ulonglong *unique, ulonglong *notnull, ulonglong records)
Definition: mi_check.cc:4132
int mi_delete(MI_INFO *file, const uchar *buff)
Definition: mi_delete.cc:50
uint space_length_bits
Definition: myisam.h:234
uint key_cache_block_size
Definition: myisam.h:354
bool need_print_msg_lock
Definition: myisam.h:378
int sortkey
Definition: myisam.h:140
uint options
Definition: myisam.h:139
uint testflag
Definition: myisam.h:354
class to copying an field/item to a key struct
Definition: sql_select.h:904
uint(* get_key)(MI_KEYDEF *keyinfo, uint nod_flag, uchar **page, uchar *key)
Definition: myisam.h:189
ha_rows total_records
Definition: myisam.h:348
ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key, key_range *max_key)
Definition: mi_range.cc:61
This file includes constants used by all storage engines.
int chk_size(MI_CHECK *param, MI_INFO *info)
Definition: mi_check.cc:315
time_t check_time
Definition: myisam.h:144
int mi_panic(enum ha_panic_function function)
Definition: mi_panic.cc:36
ulong sort_key_blocks
Definition: myisam.h:351
int(* myisam_test_invalid_symlink)(const char *filename)
Definition: mi_static.cc:72
ulonglong unique_count[MI_MAX_KEY_SEG+1]
Definition: myisam.h:368
mysql_mutex_t mutex
Definition: myisam.h:400
uchar * buff
Definition: myisam.h:318
void mi_end_bulk_insert(MI_INFO *info)
Definition: mi_write.cc:920
Definition: myisam.h:208
MI_INFO * info
Definition: myisam.h:393
int errkey
Definition: myisam.h:140
Definition: myisam.h:339
void * thd
Definition: myisam.h:373
ulonglong use_buffers
Definition: myisam.h:350
ulonglong key_file_length
Definition: myisam.h:157
int page
Definition: ctype-mb.cc:1231
char * pos
Definition: do_ctype.cc:76
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows)
Definition: mi_check.cc:4208
bool force_sort
Definition: myisam.h:357
#define HA_OFFSET_ERROR
Definition: my_base.h:1133
ulonglong myisam_mmap_size
Definition: mi_static.cc:62
uint got_error
Definition: myisam.h:399
enum_mi_stats_method
Definition: myisam.h:330
int mi_update(MI_INFO *file, const uchar *old, uchar *new_record)
Definition: mi_update.cc:37
HA_KEYSEG * end
Definition: myisam.h:205
uint16 null_pos
Definition: myisam.h:229
Definition: myisamdef.h:522
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:188
time_t update_time
Definition: myisam.h:145
my_off_t buff_length
Definition: myisam.h:388
my_off_t data_file_length
Definition: myisam.h:130
int mi_close_share(MI_INFO *file, bool *closed_share)
Definition: mi_close.cc:38
Definition: my_sys.h:360
Definition: myisam.h:151
data_file_type
Definition: my_base.h:1060
uint16 block_length
Definition: myisam.h:175
int write_data_suffix(SORT_INFO *sort_info, bool fix_datafile)
Definition: mi_check.cc:3952
Definition: myisamdef.h:241
my_off_t totaldata
Definition: myisam.h:347
uint16 flag
Definition: myisam.h:172
static uint keys
Definition: hp_test2.cc:43
ha_checksum glob_crc
Definition: myisam.h:349
int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, key_part_map keypart_map, enum ha_rkey_function search_flag)
Definition: mi_rkey.cc:35
uint16_t uint16
Definition: my_inttypes.h:64
struct st_mysql_ftparser * parser
Definition: myisam.h:185
uint max_level
Definition: myisam.h:353
ulonglong auto_increment_value
Definition: myisam.h:340
unsigned int uint
Definition: uca-dump.cc:29
#define FN_REFLEN
Definition: my_io.h:82
char * isam_file_name
Definition: myisam.h:358
File filenr
Definition: myisam.h:142
uint out_flag
Definition: myisam.h:352
int test_if_almost_full(MI_INFO *info)
Definition: mi_check.cc:3790
int chk_key(MI_CHECK *param, MI_INFO *info)
Definition: mi_check.cc:374
my_off_t search_after_block
Definition: myisam.h:345
char temp_filename[FN_REFLEN]
Definition: myisam.h:358
uint32_t uint32
Definition: my_inttypes.h:66
void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, bool repair)
Definition: mi_check.cc:4036
uint warning_printed
Definition: myisam.h:352
uchar * intervalls
Definition: myisam.h:212
uchar lastkey[MI_MAX_POSSIBLE_KEY_BUFF]
Definition: myisam.h:319
int mi_rfirst(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rfirst.cc:29
int(* ck_delete)(MI_INFO *inf, uint k_nr, uchar *k, uint klen)
Definition: myisam.h:195
int movepoint(MI_INFO *info, uchar *record, my_off_t oldpos, my_off_t newpos, uint prot_key)
Definition: mi_check.cc:1699
static uint update
Definition: myisamlog.cc:88
uint16 keylength
Definition: myisam.h:177
data_file_type new_data_file_type
Definition: myisam.h:392
my_off_t newrecpos
Definition: myisam.h:128
uint8_t uint8
Definition: my_inttypes.h:62
my_off_t key_file_blocks
Definition: myisam.h:346
time_t create_time
Definition: myisam.h:143
uint threads_running
Definition: myisam.h:399
int mi_preload(MI_INFO *info, ulonglong key_map, bool ignore_leaves)
Definition: mi_preload.cc:54
Definition: plugin_ftparser.h:211
const char * db_name
Definition: myisam.h:374
uchar * buff
Definition: myisam.h:395
SORT_KEY_BLOCKS * key_block
Definition: myisam.h:396
int mi_rprev(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rprev.cc:36
uchar lastkey[MI_MAX_KEY_BUFF]
Definition: myisam.h:384
int(* 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: myisam.h:186
Definition: myisam.h:332
Definition: my_base.h:1114
ulonglong auto_increment
Definition: myisam.h:155
mysql_mutex_t THR_LOCK_myisam_mmap
Definition: my_thr_init.cc:71
static const char * key
Definition: suite_stubs.c:14
int filecopy(MI_CHECK *param, File to, File from, my_off_t start, my_off_t length, const char *type)
Definition: mi_check.cc:1964
ulonglong keys_in_use
Definition: myisam.h:342
int File
Definition: my_io_bits.h:50
MY_TMPDIR * tmpdir
Definition: myisam.h:359
int inited
Definition: myisam.h:321
uchar * end
Definition: myisam.h:382
uint total_files
Definition: myisam.h:353
unsigned long my_off_t
Definition: my_inttypes.h:77
ulong rec_per_key_part[MI_MAX_KEY_SEG *HA_MAX_POSSIBLE_KEY]
Definition: myisam.h:372
void(* unpack)(MI_COLUMNDEF *rec, MI_BIT_BUFF *buff, uchar *start, uchar *end)
Definition: myisam.h:231
mysql_mutex_t print_msg_mutex
Definition: myisam.h:377
Definition: myisam.h:334
my_off_t max_data_file_length
Definition: myisam.h:130
my_off_t key_blocks
Definition: myisam.h:347
Definition: myisam.h:336
static MI_KEYDEF keyinfo[10]
Definition: mi_test1.cc:46
my_off_t recpos
Definition: myisam.h:127
Definition: myisamdef.h:252
const char * filename
Definition: pfs_example_component_population.cc:64
static int flag
Definition: hp_test1.cc:39
uint16 maxlength
Definition: myisam.h:179
int type
Definition: http_common.h:411
uint16 underflow_block_length
Definition: myisam.h:176
int mi_write(MI_INFO *file, uchar *buff)
Definition: mi_write.cc:56
Definition: myisam.h:387
uint8 key_alg
Definition: myisam.h:174
ulong read_buffer_length
Definition: myisam.h:351
st_keycache_thread_var * keycache_thread_var()
Definition: ha_myisam.cc:1960
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
int mi_lock_database(MI_INFO *file, int lock_type)
Definition: mi_locking.cc:45
bool myisam_flush
Definition: mi_static.cc:57
ulonglong sort_buffer_length
Definition: myisam.h:344
#define MY_NABP
Definition: my_sys.h:114
uint16 keysegs
Definition: myisam.h:171
int myf
Definition: my_inttypes.h:111
my_off_t index_file_length
Definition: myisam.h:130
int mi_rlast(MI_INFO *file, uchar *buf, int inx)
Definition: mi_rlast.cc:29
uint reflength
Definition: myisam.h:146
bool myisam_single_user
Definition: mi_static.cc:57
Common #defines and includes for file and socket I/O.
uint current_key
Definition: myisam.h:390
int mi_create(const char *name, uint keys, MI_KEYDEF *keydef, uint columns, MI_COLUMNDEF *columndef, uint uniques, MI_UNIQUEDEF *uniquedef, MI_CREATE_INFO *create_info, uint flags)
Definition: mi_create.cc:52
ha_checksum key_crc[HA_MAX_POSSIBLE_KEY]
Definition: myisam.h:371
my_off_t mi_position(MI_INFO *file)
Definition: mi_info.cc:38
my_off_t dupp
Definition: myisam.h:388
int update_state_info(MI_CHECK *param, MI_INFO *info, uint update)
Definition: mi_check.cc:3970
Definition: my_base.h:1061
HA_KEYSEG * seg
Definition: myisam.h:184
uint keys
Definition: myisam.h:138
static void start(PluginFuncEnv *env)
Definition: http_server_plugin.cc:572
A better implementation of the UNIX ctype(3) library.
int(* ck_insert)(MI_INFO *inf, uint k_nr, uchar *k, uint klen)
Definition: myisam.h:194
int tmpfile_createflag
Definition: myisam.h:360
uchar key
Definition: myisam.h:203
uint error_printed
Definition: myisam.h:352
bool using_global_keycache
Definition: myisam.h:356
uint8 null_bit
Definition: myisam.h:228
enum en_fieldtype base_type
Definition: myisam.h:233
my_off_t max_index_file_length
Definition: myisam.h:130
const char * table_name
Definition: myisam.h:374
my_off_t filelength
Definition: myisam.h:388
Log info(cout, "NOTE")
int change_to_newfile(const char *filename, const char *old_ext, const char *new_ext, myf myflags)
Definition: mi_check.cc:1935
my_off_t start_check_pos
Definition: myisam.h:347
uint pack_type
Definition: myisam.h:234
int mi_assign_to_key_cache(MI_INFO *info, ulonglong key_map, KEY_CACHE *key_cache)
Definition: mi_keycache.cc:59
uint8 null_are_equal
Definition: myisam.h:204
const char * op_name
Definition: myisam.h:375
Key cache variable structures.
int mi_delete_all_rows(MI_INFO *info)
Definition: mi_delete_all.cc:34
static int flags[50]
Definition: hp_test1.cc:39
my_off_t myisam_max_temp_length
Definition: mi_static.cc:60
#define KEY_CACHE_BLOCK_SIZE
Definition: keycache.h:61
MI_DECODE_TREE * huff_tree
Definition: myisam.h:235
uint16 * table
Definition: myisam.h:210
Definition: myisam.h:316
ulong myisam_data_pointer_size
Definition: mi_static.cc:61
Definition: myisam.h:168
ulonglong myisam_mmap_used
Definition: mi_static.cc:62
uint16 length
Definition: myisam.h:226
uchar * end_pos
Definition: myisam.h:318
uint verbose
Definition: myisam.h:352
unsigned long ulong
Definition: my_inttypes.h:48
int16_t int16
Definition: my_inttypes.h:63
bool with_auto_increment
Definition: myisam.h:160
uint quick_table_bits
Definition: myisam.h:211
MYISAM_SHARE * share
Definition: myisam.h:170
MI_CHECK * param
Definition: myisam.h:394
ha_rows max_rows
Definition: myisam.h:153
Definition: my_compare.h:58
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
#define HA_MAX_POSSIBLE_KEY
Definition: my_compare.h:46
my_off_t ha_rows
Definition: my_base.h:1130
mysql_cond_t cond
Definition: myisam.h:401
ulonglong key_map
Definition: myisam.h:136
uint opt_sort_key
Definition: myisam.h:353
#define MI_MAX_KEY_BUFF
Definition: myisam.h:65
uint16 keysegs
Definition: myisam.h:202
bool retry_repair
Definition: myisam.h:357
#define MI_MAX_POSSIBLE_KEY_BUFF
Definition: myisam.h:57
uint32 ftkey_nr
Definition: myisam.h:182
int chk_status(MI_CHECK *param, MI_INFO *info)
Definition: mi_check.cc:130
int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows)
Definition: mi_write.cc:860
ha_extra_function
Definition: my_base.h:183
int mi_rsame(MI_INFO *file, uchar *record, int inx)
Definition: mi_rsame.cc:38
myf myf_rw
Definition: myisam.h:391
Definition: myisam.h:381
int mi_repair_parallel(MI_CHECK *param, MI_INFO *info, const char *name, int rep_quick, bool no_copy_stat)
Definition: mi_check.cc:2391