170
178
{"correct-checksum", OPT_CORRECT_CHECKSUM,
171
179
"Correct checksum information for table.",
172
180
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
183
"Output debug log. Often this is 'd:t:o,filename'.",
184
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
173
186
{"description", 'd',
174
187
"Prints some information about table.",
175
188
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
176
189
{"data-file-length", 'D',
177
190
"Max length of data file (when recreating data-file when it's full).",
178
(char**) &check_param.max_data_file_length,
179
(char**) &check_param.max_data_file_length,
191
(uchar**) &check_param.max_data_file_length,
192
(uchar**) &check_param.max_data_file_length,
180
193
0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
181
194
{"extend-check", 'e',
182
195
"If used when checking a table, ensure that the table is 100 percent consistent, which will take a long time. If used when repairing a table, try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option with repair if you are not totally desperate.",
198
211
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
199
212
{"keys-used", 'k',
200
213
"Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts.",
201
(char**) &check_param.keys_in_use,
202
(char**) &check_param.keys_in_use,
214
(uchar**) &check_param.keys_in_use,
215
(uchar**) &check_param.keys_in_use,
203
216
0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
204
217
{"max-record-length", OPT_MAX_RECORD_LENGTH,
205
218
"Skip rows bigger than this if myisamchk can't allocate memory to hold it",
206
(char**) &check_param.max_record_length,
207
(char**) &check_param.max_record_length,
208
0, GET_ULL, REQUIRED_ARG, INT64_MAX, 0, INT64_MAX, 0, 0, 0},
219
(uchar**) &check_param.max_record_length,
220
(uchar**) &check_param.max_record_length,
221
0, GET_ULL, REQUIRED_ARG, LONGLONG_MAX, 0, LONGLONG_MAX, 0, 0, 0},
209
222
{"medium-check", 'm',
210
223
"Faster than extend-check, but only finds 99.99% of all errors. Should be good enough for most cases.",
211
224
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
234
247
{"set-auto-increment", 'A',
235
248
"Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.",
236
(char**) &check_param.auto_increment_value,
237
(char**) &check_param.auto_increment_value,
249
(uchar**) &check_param.auto_increment_value,
250
(uchar**) &check_param.auto_increment_value,
238
251
0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0},
239
252
{"set-collation", OPT_SET_COLLATION,
240
253
"Change the collation used by the index",
241
(char**) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
254
(uchar**) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
242
255
{"set-variable", 'O',
243
256
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
244
257
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
273
286
"Wait if table is locked.",
274
287
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
275
288
{ "key_buffer_size", OPT_KEY_BUFFER_SIZE, "",
276
(char**) &check_param.use_buffers, (char**) &check_param.use_buffers, 0,
289
(uchar**) &check_param.use_buffers, (uchar**) &check_param.use_buffers, 0,
277
290
GET_ULONG, REQUIRED_ARG, (long) USE_BUFFER_INIT, (long) MALLOC_OVERHEAD,
278
INT32_MAX, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0},
291
(long) ~0L, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0},
279
292
{ "key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE, "",
280
(char**) &opt_key_cache_block_size,
281
(char**) &opt_key_cache_block_size, 0,
293
(uchar**) &opt_key_cache_block_size,
294
(uchar**) &opt_key_cache_block_size, 0,
282
295
GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
283
296
MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
284
297
{ "myisam_block_size", OPT_MYISAM_BLOCK_SIZE, "",
285
(char**) &opt_myisam_block_size, (char**) &opt_myisam_block_size, 0,
298
(uchar**) &opt_myisam_block_size, (uchar**) &opt_myisam_block_size, 0,
286
299
GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
287
300
MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
288
301
{ "read_buffer_size", OPT_READ_BUFFER_SIZE, "",
289
(char**) &check_param.read_buffer_length,
290
(char**) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
302
(uchar**) &check_param.read_buffer_length,
303
(uchar**) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
291
304
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
292
INT32_MAX, (long) MALLOC_OVERHEAD, (long) 1L, 0},
305
(long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
293
306
{ "write_buffer_size", OPT_WRITE_BUFFER_SIZE, "",
294
(char**) &check_param.write_buffer_length,
295
(char**) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
307
(uchar**) &check_param.write_buffer_length,
308
(uchar**) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
296
309
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
297
INT32_MAX, (long) MALLOC_OVERHEAD, (long) 1L, 0},
310
(long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
298
311
{ "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "",
299
(char**) &check_param.sort_buffer_length,
300
(char**) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
312
(uchar**) &check_param.sort_buffer_length,
313
(uchar**) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
301
314
(long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD),
302
INT32_MAX, (long) MALLOC_OVERHEAD, (long) 1L, 0},
315
(long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
303
316
{ "sort_key_blocks", OPT_SORT_KEY_BLOCKS, "",
304
(char**) &check_param.sort_key_blocks,
305
(char**) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,
317
(uchar**) &check_param.sort_key_blocks,
318
(uchar**) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,
306
319
BUFFERS_WHEN_SORTING, 4L, 100L, 0L, 1L, 0},
307
{ "decode_bits", OPT_DECODE_BITS, "", (char**) &decode_bits,
308
(char**) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0},
320
{ "decode_bits", OPT_DECODE_BITS, "", (uchar**) &decode_bits,
321
(uchar**) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0},
309
322
{"stats_method", OPT_STATS_METHOD,
310
323
"Specifies how index statistics collection code should treat NULLs. "
311
324
"Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
312
325
"\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
313
(char**) &myisam_stats_method_str, (char**) &myisam_stats_method_str, 0,
326
(uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0,
314
327
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
315
328
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
332
#include <help_start.h>
319
334
static void print_version(void)
321
336
printf("%s Ver 2.7 for %s at %s\n", my_progname, SYSTEM_TYPE,
338
NETWARE_SET_SCREEN_MODE(1);
1029
1067
!(param->testflag & (T_FAST | T_FORCE_CREATE)))
1031
1069
if (param->testflag & (T_EXTEND | T_MEDIUM))
1032
init_key_cache(dflt_key_cache,opt_key_cache_block_size,
1033
param->use_buffers, 0, 0);
1034
init_io_cache(¶m->read_cache,datafile,
1035
(uint) param->read_buffer_length,
1037
(param->start_check_pos ?
1038
param->start_check_pos :
1039
share->pack.header_length),
1070
VOID(init_key_cache(dflt_key_cache,opt_key_cache_block_size,
1071
param->use_buffers, 0, 0));
1072
VOID(init_io_cache(¶m->read_cache,datafile,
1073
(uint) param->read_buffer_length,
1075
(param->start_check_pos ?
1076
param->start_check_pos :
1077
share->pack.header_length),
1042
1080
lock_memory(param);
1043
1081
if ((info->s->options & (HA_OPTION_PACK_RECORD |
1044
1082
HA_OPTION_COMPRESS_RECORD)) ||
1045
1083
(param->testflag & (T_EXTEND | T_MEDIUM)))
1046
1084
error|=chk_data_link(param, info, param->testflag & T_EXTEND);
1047
1085
error|=flush_blocks(param, share->key_cache, share->kfile);
1048
end_io_cache(¶m->read_cache);
1086
VOID(end_io_cache(¶m->read_cache));
1169
1209
if (share->state.changed & STATE_CRASHED)
1170
my_stpcpy(buff,"crashed");
1210
strmov(buff,"crashed");
1173
1213
if (share->state.open_count)
1174
pos=my_stpcpy(pos,"open,");
1214
pos=strmov(pos,"open,");
1175
1215
if (share->state.changed & STATE_CHANGED)
1176
pos=my_stpcpy(pos,"changed,");
1216
pos=strmov(pos,"changed,");
1178
pos=my_stpcpy(pos,"checked,");
1218
pos=strmov(pos,"checked,");
1179
1219
if (!(share->state.changed & STATE_NOT_ANALYZED))
1180
pos=my_stpcpy(pos,"analyzed,");
1220
pos=strmov(pos,"analyzed,");
1181
1221
if (!(share->state.changed & STATE_NOT_OPTIMIZED_KEYS))
1182
pos=my_stpcpy(pos,"optimized keys,");
1222
pos=strmov(pos,"optimized keys,");
1183
1223
if (!(share->state.changed & STATE_NOT_SORTED_PAGES))
1184
pos=my_stpcpy(pos,"sorted index pages,");
1224
pos=strmov(pos,"sorted index pages,");
1185
1225
pos[-1]=0; /* Remove extra ',' */
1187
1227
printf("Status: %s\n",buff);