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;
1686
1609
{ return FALSE; }
1687
1610
virtual char* get_foreign_key_create_info(void)
1688
1611
{ return(NULL);} /* gets foreign key create string from InnoDB */
1689
/* gets tablespace name from handler */
1690
const char* get_tablespace_name(void);
1691
1612
/** used in ALTER TABLE; 1 if changing storage engine is allowed */
1692
1613
virtual bool can_switch_engines(void) { return 1; }
1693
1614
/** used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */