forked from Meituan-Dianping/SQLAdvisor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandler.h
executable file
·610 lines (544 loc) · 19.4 KB
/
handler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
#ifndef HANDLER_INCLUDED
#define HANDLER_INCLUDED
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Definitions for parameters to do with handler-routines */
#include "my_pthread.h"
#include <algorithm>
#include "sql_const.h"
#include "mysqld.h" /* server_id */
#include "structs.h" /* SHOW_COMP_OPTION */
#include <my_global.h>
#include <my_compare.h>
#include <ft_global.h>
class MY_LOCALE;
struct TABLE_LIST;
struct LEX;
struct TABLE;
typedef struct st_changed_table_list CHANGED_TABLE_LIST;
typedef ulonglong sql_mode_t;
/* Bits in table_flags() to show what database can do */
#define HA_NO_TRANSACTIONS (1 << 0) /* Doesn't support transactions */
#define HA_PARTIAL_COLUMN_READ (1 << 1) /* read may not return all columns */
#define HA_TABLE_SCAN_ON_INDEX (1 << 2) /* No separate data/index file */
/*
The following should be set if the following is not true when scanning
a table with rnd_next()
- We will see all rows (including deleted ones)
- Row positions are 'table->s->db_record_offset' apart
If this flag is not set, filesort will do a position() call for each matched
row to be able to find the row later.
*/
#define HA_REC_NOT_IN_SEQ (1 << 3)
#define HA_CAN_GEOMETRY (1 << 4)
/*
Reading keys in random order is as fast as reading keys in sort order
(Used in records.cc to decide if we should use a record cache and by
filesort to decide if we should sort key + data or key + pointer-to-row
*/
#define HA_FAST_KEY_READ (1 << 5)
/*
Set the following flag if we on delete should force all key to be read
and on update read all keys that changes
*/
#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1 << 6)
#define HA_NULL_IN_KEY (1 << 7) /* One can have keys with NULL */
#define HA_DUPLICATE_POS (1 << 8) /* position() gives dup row */
#define HA_NO_BLOBS (1 << 9) /* Doesn't support blobs */
#define HA_CAN_INDEX_BLOBS (1 << 10)
#define HA_AUTO_PART_KEY (1 << 11) /* auto-increment in multi-part key */
#define HA_REQUIRE_PRIMARY_KEY (1 << 12) /* .. and can't create a hidden one */
#define HA_STATS_RECORDS_IS_EXACT (1 << 13) /* stats.records is exact */
/*
INSERT_DELAYED only works with handlers that uses MySQL internal table
level locks
*/
#define HA_CAN_INSERT_DELAYED (1 << 14)
/*
If we get the primary key columns for free when we do an index read
(usually, it also implies that HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
flag is set).
*/
#define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15)
/*
If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, it means that to position()
uses a primary key given by the record argument.
Without primary key, we can't call position().
If not set, the position is returned as the current rows position
regardless of what argument is given.
*/
#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16)
#define HA_CAN_RTREEKEYS (1 << 17)
#define HA_NOT_DELETE_WITH_CACHE (1 << 18)
/*
The following is we need to a primary key to delete (and update) a row.
If there is no primary key, all columns needs to be read on update and delete
*/
#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19)
#define HA_NO_PREFIX_CHAR_KEYS (1 << 20)
#define HA_CAN_FULLTEXT (1 << 21)
#define HA_CAN_SQL_HANDLER (1 << 22)
#define HA_NO_AUTO_INCREMENT (1 << 23)
#define HA_HAS_CHECKSUM (1 << 24)
/* Table data are stored in separate files (for lower_case_table_names) */
#define HA_FILE_BASED (1 << 26)
#define HA_NO_VARCHAR (1 << 27)
#define HA_CAN_BIT_FIELD (1 << 28) /* supports bit fields */
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
#define HA_NO_COPY_ON_ALTER (LL(1) << 31)
#define HA_HAS_RECORDS (LL(1) << 32) /* records() gives exact count*/
/* Has it's own method of binlog logging */
#define HA_HAS_OWN_BINLOGGING (LL(1) << 33)
/*
Note: the following includes binlog and closing 0.
so: innodb + bdb + ndb + binlog + myisam + myisammrg + archive +
example + csv + heap + blackhole + federated + 0
(yes, the sum is deliberately inaccurate)
TODO remove the limit, use dynarrays
*/
#define MAX_HA 15
#define HA_LEX_CREATE_TMP_TABLE 1
#define HA_LEX_CREATE_IF_NOT_EXISTS 2
#define HA_LEX_CREATE_TABLE_LIKE 4
#define HA_OPTION_NO_CHECKSUM (1L << 17)
#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
#define HA_MAX_REC_LENGTH 65535U
// WITH CONSISTENT SNAPSHOT option
static const uint MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT = 1;
// READ ONLY option
static const uint MYSQL_START_TRANS_OPT_READ_ONLY = 2;
// READ WRITE option
static const uint MYSQL_START_TRANS_OPT_READ_WRITE = 4;
enum legacy_db_type
{
DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1,
DB_TYPE_HASH,DB_TYPE_MISAM,DB_TYPE_PISAM,
DB_TYPE_RMS_ISAM, DB_TYPE_HEAP, DB_TYPE_ISAM,
DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM,
DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB,
DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER,
DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB,
DB_TYPE_FEDERATED_DB,
DB_TYPE_BLACKHOLE_DB,
DB_TYPE_PARTITION_DB,
DB_TYPE_BINLOG,
DB_TYPE_SOLID,
DB_TYPE_PBXT,
DB_TYPE_TABLE_FUNCTION,
DB_TYPE_MEMCACHE,
DB_TYPE_FALCON,
DB_TYPE_MARIA,
/** Performance schema engine. */
DB_TYPE_PERFORMANCE_SCHEMA,
DB_TYPE_TOKUDB=41,
DB_TYPE_FIRST_DYNAMIC=42,
DB_TYPE_DEFAULT=127 // Must be last
};
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT,
/** Unused. Reserved for future versions. */
ROW_TYPE_PAGE,
ROW_TYPE_TOKU_UNCOMPRESSED, ROW_TYPE_TOKU_ZLIB,
ROW_TYPE_TOKU_QUICKLZ, ROW_TYPE_TOKU_LZMA,
ROW_TYPE_TOKU_FAST, ROW_TYPE_TOKU_SMALL };
/* Specifies data storage format for individual columns */
enum column_format_type {
COLUMN_FORMAT_TYPE_DEFAULT= 0, /* Not specified (use engine default) */
COLUMN_FORMAT_TYPE_FIXED= 1, /* FIXED format */
COLUMN_FORMAT_TYPE_DYNAMIC= 2 /* DYNAMIC format */
};
/* struct to hold information about the table that should be created */
/* Bits in used_fields */
#define HA_CREATE_USED_AUTO (1L << 0)
#define HA_CREATE_USED_RAID (1L << 1) //RAID is no longer availble
#define HA_CREATE_USED_UNION (1L << 2)
#define HA_CREATE_USED_INSERT_METHOD (1L << 3)
#define HA_CREATE_USED_MIN_ROWS (1L << 4)
#define HA_CREATE_USED_MAX_ROWS (1L << 5)
#define HA_CREATE_USED_AVG_ROW_LENGTH (1L << 6)
#define HA_CREATE_USED_PACK_KEYS (1L << 7)
#define HA_CREATE_USED_CHARSET (1L << 8)
#define HA_CREATE_USED_DEFAULT_CHARSET (1L << 9)
#define HA_CREATE_USED_DATADIR (1L << 10)
#define HA_CREATE_USED_INDEXDIR (1L << 11)
#define HA_CREATE_USED_ENGINE (1L << 12)
#define HA_CREATE_USED_CHECKSUM (1L << 13)
#define HA_CREATE_USED_DELAY_KEY_WRITE (1L << 14)
#define HA_CREATE_USED_ROW_FORMAT (1L << 15)
#define HA_CREATE_USED_COMMENT (1L << 16)
#define HA_CREATE_USED_PASSWORD (1L << 17)
#define HA_CREATE_USED_CONNECTION (1L << 18)
#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
/** Unused. Reserved for future versions. */
#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
/** Unused. Reserved for future versions. */
#define HA_CREATE_USED_PAGE_CHECKSUM (1L << 21)
/** This is set whenever STATS_PERSISTENT=0|1|default has been
specified in CREATE/ALTER TABLE. See also HA_OPTION_STATS_PERSISTENT in
include/my_base.h. It is possible to distinguish whether
STATS_PERSISTENT=default has been specified or no STATS_PERSISTENT= is
given at all. */
#define HA_CREATE_USED_STATS_PERSISTENT (1L << 22)
/**
This is set whenever STATS_AUTO_RECALC=0|1|default has been
specified in CREATE/ALTER TABLE. See enum_stats_auto_recalc.
It is possible to distinguish whether STATS_AUTO_RECALC=default
has been specified or no STATS_AUTO_RECALC= is given at all.
*/
#define HA_CREATE_USED_STATS_AUTO_RECALC (1L << 23)
/**
This is set whenever STATS_SAMPLE_PAGES=N|default has been
specified in CREATE/ALTER TABLE. It is possible to distinguish whether
STATS_SAMPLE_PAGES=default has been specified or no STATS_SAMPLE_PAGES= is
given at all.
*/
#define HA_CREATE_USED_STATS_SAMPLE_PAGES (1L << 24)
typedef ulonglong my_xid; // this line is the same as in log_event.h
#define MYSQL_XID_PREFIX "MySQLXid"
#define MYSQL_XID_PREFIX_LEN 8 // must be a multiple of 8
#define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN)
#define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid))
#define XIDDATASIZE MYSQL_XIDDATASIZE
#define MAXGTRIDSIZE 64
#define MAXBQUALSIZE 64
/**
struct xid_t is binary compatible with the XID structure as
in the X/Open CAE Specification, Distributed Transaction Processing:
The XA Specification, X/Open Company Ltd., 1991.
http://www.opengroup.org/bookstore/catalog/c193.htm
@see MYSQL_XID in mysql/plugin.h
*/
struct xid_t {
long formatID;
long gtrid_length;
long bqual_length;
char data[XIDDATASIZE]; // not \0-terminated !
xid_t() {} /* Remove gcc warning */
bool eq(struct xid_t *xid)
{ return eq(xid->gtrid_length, xid->bqual_length, xid->data); }
bool eq(long g, long b, const char *d)
{ return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); }
void set(struct xid_t *xid)
{ memcpy(this, xid, xid->length()); }
void set(long f, const char *g, long gl, const char *b, long bl)
{
formatID= f;
memcpy(data, g, gtrid_length= gl);
memcpy(data+gl, b, bqual_length= bl);
}
void set(ulonglong xid)
{
my_xid tmp;
formatID= 1;
set(MYSQL_XID_PREFIX_LEN, 0, MYSQL_XID_PREFIX);
tmp= xid;
memcpy(data+MYSQL_XID_OFFSET, &tmp, sizeof(tmp));
gtrid_length=MYSQL_XID_GTRID_LEN;
}
void set(long g, long b, const char *d)
{
formatID= 1;
gtrid_length= g;
bqual_length= b;
memcpy(data, d, g+b);
}
bool is_null() { return formatID == -1; }
void null() { formatID= -1; }
my_xid quick_get_my_xid()
{
my_xid tmp;
memcpy(&tmp, data+MYSQL_XID_OFFSET, sizeof(tmp));
return tmp;
}
my_xid get_my_xid()
{
return gtrid_length == MYSQL_XID_GTRID_LEN && bqual_length == 0 &&
!memcmp(data, MYSQL_XID_PREFIX, MYSQL_XID_PREFIX_LEN) ?
quick_get_my_xid() : 0;
}
uint length()
{
return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+
gtrid_length+bqual_length;
}
uchar *key()
{
return (uchar *)>rid_length;
}
uint key_length()
{
return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length;
}
};
typedef struct xid_t XID;
/* for recover() handlerton call */
#define MIN_XID_LIST_SIZE 128
#define MAX_XID_LIST_SIZE (1024*128)
/*
These structures are used to pass information from a set of SQL commands
on add/drop/change tablespace definitions to the proper hton.
*/
#define UNDEF_NODEGROUP 65535
enum ts_command_type
{
TS_CMD_NOT_DEFINED = -1,
CREATE_TABLESPACE = 0,
ALTER_TABLESPACE = 1,
CREATE_LOGFILE_GROUP = 2,
ALTER_LOGFILE_GROUP = 3,
DROP_TABLESPACE = 4,
DROP_LOGFILE_GROUP = 5,
CHANGE_FILE_TABLESPACE = 6,
ALTER_ACCESS_MODE_TABLESPACE = 7
};
enum ts_alter_tablespace_type
{
TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1,
ALTER_TABLESPACE_ADD_FILE = 1,
ALTER_TABLESPACE_DROP_FILE = 2
};
enum tablespace_access_mode
{
TS_NOT_DEFINED= -1,
TS_READ_ONLY = 0,
TS_READ_WRITE = 1,
TS_NOT_ACCESSIBLE = 2
};
struct handlerton;
class st_alter_tablespace : public Sql_alloc
{
public:
const char *tablespace_name;
const char *logfile_group_name;
enum ts_command_type ts_cmd_type;
enum ts_alter_tablespace_type ts_alter_tablespace_type;
const char *data_file_name;
const char *undo_file_name;
const char *redo_file_name;
ulonglong extent_size;
ulonglong undo_buffer_size;
ulonglong redo_buffer_size;
ulonglong initial_size;
ulonglong autoextend_size;
ulonglong max_size;
uint nodegroup_id;
handlerton *storage_engine;
bool wait_until_completed;
const char *ts_comment;
enum tablespace_access_mode ts_access_mode;
st_alter_tablespace()
{
tablespace_name= NULL;
logfile_group_name= "DEFAULT_LG"; //Default log file group
ts_cmd_type= TS_CMD_NOT_DEFINED;
data_file_name= NULL;
undo_file_name= NULL;
redo_file_name= NULL;
extent_size= 1024*1024; //Default 1 MByte
undo_buffer_size= 8*1024*1024; //Default 8 MByte
redo_buffer_size= 8*1024*1024; //Default 8 MByte
initial_size= 128*1024*1024; //Default 128 MByte
autoextend_size= 0; //No autoextension as default
max_size= 0; //Max size == initial size => no extension
storage_engine= NULL;
nodegroup_id= UNDEF_NODEGROUP;
wait_until_completed= TRUE;
ts_comment= NULL;
ts_access_mode= TS_NOT_DEFINED;
}
};
/*
Make sure that the order of schema_tables and enum_schema_tables are the same.
*/
enum enum_schema_tables
{
SCH_CHARSETS= 0,
SCH_CLIENT_STATS,
SCH_COLLATIONS,
SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
SCH_COLUMNS,
SCH_COLUMN_PRIVILEGES,
SCH_INDEX_STATS,
SCH_ENGINES,
SCH_EVENTS,
SCH_FILES,
SCH_GLOBAL_STATUS,
SCH_GLOBAL_TEMPORARY_TABLES,
SCH_GLOBAL_VARIABLES,
SCH_KEY_COLUMN_USAGE,
SCH_OPEN_TABLES,
SCH_OPTIMIZER_TRACE,
SCH_PARAMETERS,
SCH_PARTITIONS,
SCH_PLUGINS,
SCH_PROCESSLIST,
SCH_PROFILES,
SCH_REFERENTIAL_CONSTRAINTS,
SCH_PROCEDURES,
SCH_SCHEMATA,
SCH_SCHEMA_PRIVILEGES,
SCH_SESSION_STATUS,
SCH_SESSION_VARIABLES,
SCH_STATISTICS,
SCH_STATUS,
SCH_TABLES,
SCH_TABLESPACES,
SCH_TABLE_CONSTRAINTS,
SCH_TABLE_NAMES,
SCH_TABLE_PRIVILEGES,
SCH_TABLE_STATS,
SCH_TEMPORARY_TABLES,
SCH_THREAD_STATS,
SCH_TRIGGERS,
SCH_USER_PRIVILEGES,
SCH_USER_STATS,
SCH_VARIABLES,
SCH_VIEWS
};
class handler;
/*
handlerton is a singleton structure - one instance per storage engine -
to provide access to storage engine functionality that works on the
"global" level (unlike handler class that works on a per-table basis)
usually handlerton instance is defined statically in ha_xxx.cc as
static handlerton { ... } xxx_hton;
savepoint_*, prepare, recover, and *_by_xid pointers can be 0.
*/
struct handlerton
{
/*
Historical number used for frm file to determine the correct storage engine.
This is going away and new engines will just use "name" for this.
*/
enum legacy_db_type db_type;
/*
each storage engine has it's own memory area (actually a pointer)
in the thd, for storing per-connection information.
It is accessed as
thd->ha_data[xxx_hton.slot]
slot number is initialized by MySQL after xxx_init() is called.
*/
uint slot;
/*
to store per-savepoint data storage engine is provided with an area
of a requested size (0 is ok here).
savepoint_offset must be initialized statically to the size of
the needed memory to store per-savepoint information.
After xxx_init it is changed to be an offset to savepoint storage
area and need not be used by storage engine.
see binlog_hton and binlog_savepoint_set/rollback for an example.
*/
uint savepoint_offset;
uint32 flags; /* global handler flags */
uint32 license; /* Flag for Engine License */
void *data; /* Location for engines to keep personal structures */
};
/* In which table to INSERT rows */
#define MERGE_INSERT_DISABLED 0
#define MERGE_INSERT_TO_FIRST 1
#define MERGE_INSERT_TO_LAST 2
/* Possible flags of a handlerton (there can be 32 of them) */
#define HTON_NO_FLAGS 0
#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
#define HTON_ALTER_NOT_SUPPORTED (1 << 1) //Engine does not support alter
#define HTON_CAN_RECREATE (1 << 2) //Delete all is used fro truncate
#define HTON_HIDDEN (1 << 3) //Engine does not appear in lists
#define HTON_FLUSH_AFTER_RENAME (1 << 4)
#define HTON_NOT_USER_SELECTABLE (1 << 5)
#define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported
#define HTON_SUPPORT_LOG_TABLES (1 << 7) //Engine supports log tables
#define HTON_NO_PARTITION (1 << 8) //You can not partition these tables
typedef struct {
ulonglong data_file_length;
ulonglong max_data_file_length;
ulonglong index_file_length;
ulonglong delete_length;
ha_rows records;
ulong mean_rec_length;
ulong create_time;
ulong check_time;
ulong update_time;
ulonglong check_sum;
} PARTITION_STATS;
#define UNDEF_NODEGROUP 65535
class Item;
struct st_table_log_memory_entry;
class partition_info;
struct st_partition_iter;
enum enum_ha_unused { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES };
enum enum_stats_auto_recalc { HA_STATS_AUTO_RECALC_DEFAULT= 0,
HA_STATS_AUTO_RECALC_ON,
HA_STATS_AUTO_RECALC_OFF };
typedef struct st_ha_create_information
{
const CHARSET_INFO *table_charset, *default_table_charset;
LEX_STRING connect_string;
const char *password, *tablespace;
LEX_STRING comment;
const char *data_file_name, *index_file_name;
const char *alias;
ulonglong max_rows,min_rows;
ulonglong auto_increment_value;
ulong table_options;
ulong avg_row_length;
ulong used_fields;
ulong key_block_size;
uint stats_sample_pages; /* number of pages to sample during
stats estimation, if used, otherwise 0. */
enum_stats_auto_recalc stats_auto_recalc;
SQL_I_List<TABLE_LIST> merge_list;
handlerton *db_type;
/**
Row type of the table definition.
Defaults to ROW_TYPE_DEFAULT for all non-ALTER statements.
For ALTER TABLE defaults to ROW_TYPE_NOT_USED (means "keep the current").
Can be changed either explicitly by the parser.
If nothing speficied inherits the value of the original table (if present).
*/
enum row_type row_type;
uint null_bits; /* NULL bits at start of record */
uint options; /* OR of HA_CREATE_ options */
uint merge_insert_method;
uint extra_size; /* length of extra data segment */
bool varchar; /* 1 if table has a VARCHAR */
enum ha_storage_media storage_media; /* DEFAULT, DISK or MEMORY */
} HA_CREATE_INFO;
typedef struct st_key_create_information
{
enum ha_key_alg algorithm;
ulong block_size;
LEX_STRING parser_name;
LEX_STRING comment;
/**
A flag to determine if we will check for duplicate indexes.
This typically means that the key information was specified
directly by the user (set by the parser) or a column
associated with it was dropped.
*/
bool check_for_duplicate_indexes;
} KEY_CREATE_INFO;
extern KEY_CREATE_INFO default_key_create_info;
typedef struct st_ha_check_opt
{
st_ha_check_opt() {} /* Remove gcc warning */
uint flags; /* isam layer flags (e.g. for myisamchk) */
uint sql_flags; /* sql layer flags - for something myisamchk cannot do */
void init()
{
flags= sql_flags= 0;
}
} HA_CHECK_OPT;
#endif /* HANDLER_INCLUDED */