144
144
uses a primary key. Without primary key, we can't call position().
146
146
#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16)
147
#define HA_CAN_RTREEKEYS (1 << 17)
147
#define HA_CAN_RTREEKEYS (1 << 17) /* Historical, no longer supported */
148
148
#define HA_NOT_DELETE_WITH_CACHE (1 << 18)
150
150
The following is we need to a primary key to delete (and update) a row.
153
153
#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19)
154
154
#define HA_NO_PREFIX_CHAR_KEYS (1 << 20)
155
#define HA_CAN_FULLTEXT (1 << 21)
156
#define HA_CAN_SQL_HANDLER (1 << 22)
155
#define HA_CAN_FULLTEXT (1 << 21) /* Historical, no longer supported */
156
#define HA_CAN_SQL_HANDLER (1 << 22) /* Historical, no longer supported */
157
157
#define HA_NO_AUTO_INCREMENT (1 << 23)
158
158
#define HA_HAS_CHECKSUM (1 << 24)
159
159
/* Table data are stored in separate files (for lower_case_table_names) */
160
160
#define HA_FILE_BASED (1 << 26)
161
#define HA_NO_VARCHAR (1 << 27)
162
#define HA_CAN_BIT_FIELD (1 << 28) /* supports bit fields */
161
#define HA_NO_VARCHAR (1 << 27) /* Historical, no longer supported */
162
#define HA_CAN_BIT_FIELD (1 << 28) /* Historical, no longer supported */
163
163
#define HA_NEED_READ_RANGE_BUFFER (1 << 29) /* for read_multi_range */
164
164
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
165
165
#define HA_NO_COPY_ON_ALTER (1LL << 31)
166
166
#define HA_HAS_RECORDS (1LL << 32) /* records() gives exact count*/
167
167
/* Has it's own method of binlog logging */
168
#define HA_HAS_OWN_BINLOGGING (1LL << 33)
168
#define HA_HAS_OWN_BINLOGGING (1LL << 33) /* Historical, no longer supported */
169
169
#define HA_MRR_CANT_SORT (1LL << 34)
344
344
/* Bits in used_fields */
345
345
#define HA_CREATE_USED_AUTO (1L << 0)
346
#define HA_CREATE_USED_RAID (1L << 1) //RAID is no longer availble
346
#define HA_CREATE_USED_RAID (1L << 1) /* Historical, no longer supported */
347
347
#define HA_CREATE_USED_UNION (1L << 2)
348
348
#define HA_CREATE_USED_INSERT_METHOD (1L << 3)
349
349
#define HA_CREATE_USED_MIN_ROWS (1L << 4)
457
457
#define MIN_XID_LIST_SIZE 128
458
458
#define MAX_XID_LIST_SIZE (1024*128)
461
These structures are used to pass information from a set of SQL commands
462
on add/drop/change tablespace definitions to the proper hton.
464
#define UNDEF_NODEGROUP 65535
467
TS_CMD_NOT_DEFINED = -1,
468
CREATE_TABLESPACE = 0,
469
ALTER_TABLESPACE = 1,
470
CREATE_LOGFILE_GROUP = 2,
471
ALTER_LOGFILE_GROUP = 3,
473
DROP_LOGFILE_GROUP = 5,
474
CHANGE_FILE_TABLESPACE = 6,
475
ALTER_ACCESS_MODE_TABLESPACE = 7
478
enum ts_alter_tablespace_type
480
TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1,
481
ALTER_TABLESPACE_ADD_FILE = 1,
482
ALTER_TABLESPACE_DROP_FILE = 2
485
enum tablespace_access_mode
490
TS_NOT_ACCESSIBLE = 2
493
460
struct handlerton;
494
class st_alter_tablespace : public Sql_alloc
497
const char *tablespace_name;
498
const char *logfile_group_name;
499
enum ts_command_type ts_cmd_type;
500
enum ts_alter_tablespace_type ts_alter_tablespace_type;
501
const char *data_file_name;
502
const char *undo_file_name;
503
const char *redo_file_name;
504
uint64_t extent_size;
505
uint64_t undo_buffer_size;
506
uint64_t redo_buffer_size;
507
uint64_t initial_size;
508
uint64_t autoextend_size;
511
handlerton *storage_engine;
512
bool wait_until_completed;
513
const char *ts_comment;
514
enum tablespace_access_mode ts_access_mode;
515
st_alter_tablespace()
517
tablespace_name= NULL;
518
logfile_group_name= "DEFAULT_LG"; //Default log file group
519
ts_cmd_type= TS_CMD_NOT_DEFINED;
520
data_file_name= NULL;
521
undo_file_name= NULL;
522
redo_file_name= NULL;
523
extent_size= 1024*1024; //Default 1 MByte
524
undo_buffer_size= 8*1024*1024; //Default 8 MByte
525
redo_buffer_size= 8*1024*1024; //Default 8 MByte
526
initial_size= 128*1024*1024; //Default 128 MByte
527
autoextend_size= 0; //No autoextension as default
528
max_size= 0; //Max size == initial size => no extension
529
storage_engine= NULL;
530
nodegroup_id= UNDEF_NODEGROUP;
531
wait_until_completed= TRUE;
533
ts_access_mode= TS_NOT_DEFINED;
537
462
/* The handler for a table type. Will be included in the TABLE structure */
632
557
int (*start_consistent_snapshot)(handlerton *hton, THD *thd);
633
558
bool (*flush_logs)(handlerton *hton);
634
559
bool (*show_status)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat);
635
int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info);
636
560
int (*fill_files_table)(handlerton *hton, THD *thd,
637
561
TABLE_LIST *tables,
638
562
class Item *cond);
833
757
CHARSET_INFO *table_charset, *default_table_charset;
834
758
LEX_STRING connect_string;
835
const char *password, *tablespace;
836
759
LEX_STRING comment;
837
760
const char *data_file_name, *index_file_name;
838
761
const char *alias;
854
777
bool table_existed; /* 1 in create if table existed */
855
778
bool frm_only; /* 1 if no ha_create_table() */
856
779
bool varchar; /* 1 if table has a VARCHAR */
857
enum ha_storage_media default_storage_media; /* DEFAULT, DISK or MEMORY */
858
780
enum ha_choice page_checksum; /* If we have page_checksums */
859
781
} HA_CREATE_INFO;
1687
1609
{ return FALSE; }
1688
1610
virtual char* get_foreign_key_create_info(void)
1689
1611
{ return(NULL);} /* gets foreign key create string from InnoDB */
1690
/* gets tablespace name from handler */
1691
const char* get_tablespace_name(void);
1692
1612
/** used in ALTER TABLE; 1 if changing storage engine is allowed */
1693
1613
virtual bool can_switch_engines(void) { return 1; }
1694
1614
/** used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */