Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2029 06/01/11 12:01:36 andrey@lmy004. +7 -0
manual merge
sql/sql_yacc.yy
1.434 06/01/11 12:01:29 andrey@lmy004. +54 -143
manual merge
sql/share/errmsg.txt
1.69 06/01/11 12:01:29 andrey@lmy004. +6 -38
manual merge
libmysqld/Makefile.am
1.76 06/01/11 12:01:29 andrey@lmy004. +2 -2
manual merge
sql/sql_parse.cc
1.507 06/01/11 11:46:28 andrey@lmy004. +0 -0
Auto merged
sql/sql_lex.h
1.210 06/01/11 11:46:26 andrey@lmy004. +0 -0
Auto merged
sql/lex.h
1.151 06/01/11 11:46:25 andrey@lmy004. +0 -0
Auto merged
sql/Makefile.am
1.126 06/01/11 11:46:25 andrey@lmy004. +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: andrey
# Host: lmy004.
# Root: /work/mysql-5.1-tt-copy-works/RESYNC
--- 1.125/sql/Makefile.am 2006-01-10 19:50:16 +01:00
+++ 1.126/sql/Makefile.am 2006-01-11 11:46:25 +01:00
@@ -99,7 +99,7 @@
sp_cache.cc parse_file.cc sql_trigger.cc \
event_executor.cc event.cc event_timed.cc \
sql_plugin.cc sql_binlog.cc \
- handlerton.cc
+ handlerton.cc sql_tablespace.cc
EXTRA_mysqld_SOURCES = ha_innodb.cc ha_berkeley.cc ha_archive.cc \
ha_innodb.h ha_berkeley.h ha_archive.h \
ha_blackhole.cc ha_federated.cc ha_ndbcluster.cc \
--- 1.150/sql/lex.h 2006-01-10 19:50:16 +01:00
+++ 1.151/sql/lex.h 2006-01-11 11:46:25 +01:00
@@ -59,6 +59,7 @@
{ "<<", SYM(SHIFT_LEFT)},
{ ">>", SYM(SHIFT_RIGHT)},
{ "<=>", SYM(EQUAL_SYM)},
+ { "ACCESSIBLE", SYM(ACCESSIBLE_SYM)},
{ "ACTION", SYM(ACTION)},
{ "ADD", SYM(ADD)},
{ "AFTER", SYM(AFTER_SYM)},
@@ -77,6 +78,7 @@
{ "AT", SYM(AT_SYM)},
{ "AUTHORS", SYM(AUTHORS_SYM)},
{ "AUTO_INCREMENT", SYM(AUTO_INC)},
+ { "AUTOEXTEND_SIZE", SYM(AUTOEXTEND_SIZE_SYM)},
{ "AVG", SYM(AVG_SYM)},
{ "AVG_ROW_LENGTH", SYM(AVG_ROW_LENGTH)},
{ "BACKUP", SYM(BACKUP_SYM)},
@@ -143,6 +145,7 @@
{ "DATA", SYM(DATA_SYM)},
{ "DATABASE", SYM(DATABASE)},
{ "DATABASES", SYM(DATABASES)},
+ { "DATAFILE", SYM(DATAFILE_SYM)},
{ "DATE", SYM(DATE_SYM)},
{ "DATETIME", SYM(DATETIME)},
{ "DAY", SYM(DAY_SYM)},
@@ -167,6 +170,7 @@
{ "DISABLE", SYM(DISABLE_SYM)},
{ "DISABLED", SYM(DISABLED_SYM)},
{ "DISCARD", SYM(DISCARD)},
+ { "DISK", SYM(DISK_SYM)},
{ "DISTINCT", SYM(DISTINCT)},
{ "DISTINCTROW", SYM(DISTINCT)}, /* Access likes this */
{ "DIV", SYM(DIV_SYM)},
@@ -200,6 +204,7 @@
{ "EXPANSION", SYM(EXPANSION_SYM)},
{ "EXPLAIN", SYM(DESCRIBE)},
{ "EXTENDED", SYM(EXTENDED_SYM)},
+ { "EXTENT_SIZE", SYM(EXTENT_SIZE_SYM)},
{ "FALSE", SYM(FALSE_SYM)},
{ "FAST", SYM(FAST_SYM)},
{ "FETCH", SYM(FETCH_SYM)},
@@ -248,6 +253,7 @@
{ "INDEX", SYM(INDEX_SYM)},
{ "INDEXES", SYM(INDEXES)},
{ "INFILE", SYM(INFILE)},
+ { "INITIAL_SIZE", SYM(INITIAL_SIZE_SYM)},
{ "INNER", SYM(INNER_SYM)},
{ "INNOBASE", SYM(INNOBASE_SYM)},
{ "INNODB", SYM(INNOBASE_SYM)},
@@ -299,6 +305,7 @@
{ "LOCALTIMESTAMP", SYM(NOW_SYM)},
{ "LOCK", SYM(LOCK_SYM)},
{ "LOCKS", SYM(LOCKS_SYM)},
+ { "LOGFILE", SYM(LOGFILE_SYM)},
{ "LOGS", SYM(LOGS_SYM)},
{ "LONG", SYM(LONG_SYM)},
{ "LONGBLOB", SYM(LONGBLOB)},
@@ -324,6 +331,7 @@
{ "MAX_CONNECTIONS_PER_HOUR", SYM(MAX_CONNECTIONS_PER_HOUR)},
{ "MAX_QUERIES_PER_HOUR", SYM(MAX_QUERIES_PER_HOUR)},
{ "MAX_ROWS", SYM(MAX_ROWS)},
+ { "MAX_SIZE", SYM(MAX_SIZE_SYM)},
{ "MAX_UPDATES_PER_HOUR", SYM(MAX_UPDATES_PER_HOUR)},
{ "MAX_USER_CONNECTIONS", SYM(MAX_USER_CONNECTIONS_SYM)},
{ "MAXVALUE", SYM(MAX_VALUE_SYM)},
@@ -331,6 +339,7 @@
{ "MEDIUMBLOB", SYM(MEDIUMBLOB)},
{ "MEDIUMINT", SYM(MEDIUMINT)},
{ "MEDIUMTEXT", SYM(MEDIUMTEXT)},
+ { "MEMORY", SYM(MEMORY_SYM)},
{ "MERGE", SYM(MERGE_SYM)},
{ "MICROSECOND", SYM(MICROSECOND_SYM)},
{ "MIDDLEINT", SYM(MEDIUMINT)}, /* For powerbuilder */
@@ -358,7 +367,8 @@
{ "NEW", SYM(NEW_SYM)},
{ "NEXT", SYM(NEXT_SYM)},
{ "NO", SYM(NO_SYM)},
- { "NODEGROUP", SYM(NODEGROUP_SYM)},
+ { "NO_WAIT", SYM(NO_WAIT_SYM)},
+ { "NODEGROUP", SYM(NODEGROUP_SYM)},
{ "NONE", SYM(NONE_SYM)},
{ "NOT", SYM(NOT_SYM)},
{ "NO_WRITE_TO_BINLOG", SYM(NO_WRITE_TO_BINLOG)},
@@ -408,9 +418,13 @@
{ "RAID_TYPE", SYM(RAID_TYPE)},
{ "RANGE", SYM(RANGE_SYM)},
{ "READ", SYM(READ_SYM)},
+ { "READ_ONLY", SYM(READ_ONLY_SYM)},
+ { "READ_WRITE", SYM(READ_WRITE_SYM)},
{ "READS", SYM(READS_SYM)},
{ "REAL", SYM(REAL)},
{ "RECOVER", SYM(RECOVER_SYM)},
+ { "REDO_BUFFER_SIZE", SYM(REDO_BUFFER_SIZE_SYM)},
+ { "REDOFILE", SYM(REDOFILE_SYM)},
{ "REDUNDANT", SYM(REDUNDANT_SYM)},
{ "REFERENCES", SYM(REFERENCES)},
{ "REGEXP", SYM(REGEXP)},
@@ -532,6 +546,8 @@
{ "TYPES", SYM(TYPES_SYM)},
{ "UNCOMMITTED", SYM(UNCOMMITTED_SYM)},
{ "UNDEFINED", SYM(UNDEFINED_SYM)},
+ { "UNDO_BUFFER_SIZE", SYM(UNDO_BUFFER_SIZE_SYM)},
+ { "UNDOFILE", SYM(UNDOFILE_SYM)},
{ "UNDO", SYM(UNDO_SYM)},
{ "UNICODE", SYM(UNICODE_SYM)},
{ "UNION", SYM(UNION_SYM)},
@@ -558,6 +574,7 @@
{ "VARCHARACTER", SYM(VARCHAR)},
{ "VARIABLES", SYM(VARIABLES)},
{ "VARYING", SYM(VARYING)},
+ { "WAIT", SYM(WAIT_SYM)},
{ "WARNINGS", SYM(WARNINGS)},
{ "WEEK", SYM(WEEK_SYM)},
{ "WHEN", SYM(WHEN_SYM)},
--- 1.209/sql/sql_lex.h 2006-01-10 21:02:09 +01:00
+++ 1.210/sql/sql_lex.h 2006-01-11 11:46:26 +01:00
@@ -25,6 +25,7 @@
class sp_name;
class sp_instr;
class sp_pcontext;
+class st_alter_tablespace;
class partition_info;
class event_timed;
@@ -93,6 +94,7 @@
SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE,
SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE,
+ SQLCOM_ALTER_TABLESPACE,
SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN,
SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT,
SQLCOM_SHOW_PLUGINS,
@@ -960,6 +962,12 @@
during replication ("LOCAL 'filename' REPLACE INTO" part).
*/
const uchar *fname_start, *fname_end;
+
+ /*
+ Reference to a struct that contains information in various commands
+ to add/create/drop/change table spaces.
+ */
+ st_alter_tablespace *alter_tablespace_info;
bool escape_used;
--- 1.506/sql/sql_parse.cc 2006-01-10 19:50:19 +01:00
+++ 1.507/sql/sql_parse.cc 2006-01-11 11:46:28 +01:00
@@ -4877,6 +4877,12 @@
case SQLCOM_XA_RECOVER:
res= mysql_xa_recover(thd);
break;
+ case SQLCOM_ALTER_TABLESPACE:
+ if (check_access(thd, ALTER_ACL, thd->db, 0, 1, 0, thd->db ? is_schema_db(thd->db) : 0))
+ break;
+ if (!(res= mysql_alter_tablespace(thd, lex->alter_tablespace_info)))
+ send_ok(thd);
+ break;
case SQLCOM_INSTALL_PLUGIN:
if (! (res= mysql_install_plugin(thd, &thd->lex->comment,
&thd->lex->ident)))
--- 1.433/sql/sql_yacc.yy 2006-01-10 21:02:09 +01:00
+++ 1.434/sql/sql_yacc.yy 2006-01-11 12:01:29 +01:00
@@ -121,6 +121,7 @@
%token END_OF_INPUT
%token ABORT_SYM
+%token ACCESSIBLE_SYM
%token ACTION
%token ADD
%token ADDDATE_SYM
@@ -142,6 +143,7 @@
%token ATAN
%token AUTHORS_SYM
%token AUTO_INC
+%token AUTOEXTEND_SIZE_SYM
%token AVG_ROW_LENGTH
%token AVG_SYM
%token BACKUP_SYM
@@ -212,6 +214,7 @@
%token CURTIME
%token DATABASE
%token DATABASES
+%token DATAFILE_SYM
%token DATA_SYM
%token DATETIME
%token DATE_ADD_INTERVAL
@@ -242,6 +245,7 @@
%token DISABLE_SYM
%token DISABLED_SYM
%token DISCARD
+%token DISK_SYM
%token DISTINCT
%token DIV_SYM
%token DOUBLE_SYM
@@ -278,6 +282,7 @@
%token EXPANSION_SYM
%token EXPORT_SET
%token EXTENDED_SYM
+%token EXTENT_SIZE_SYM
%token EXTRACT_SYM
%token FALSE_SYM
%token FAST_SYM
@@ -340,6 +345,7 @@
%token INDEXES
%token INDEX_SYM
%token INFILE
+%token INITIAL_SIZE_SYM
%token INNER_SYM
%token INNOBASE_SYM
%token INOUT_SYM
@@ -386,6 +392,7 @@
%token LOCATOR_SYM
%token LOCKS_SYM
%token LOCK_SYM
+%token LOGFILE_SYM
%token LOGS_SYM
%token LOG_SYM
%token LONGBLOB
@@ -416,6 +423,7 @@
%token MAX_CONNECTIONS_PER_HOUR
%token MAX_QUERIES_PER_HOUR
%token MAX_ROWS
+%token MAX_SIZE_SYM
%token MAX_SYM
%token MAX_UPDATES_PER_HOUR
%token MAX_USER_CONNECTIONS_SYM
@@ -424,6 +432,7 @@
%token MEDIUMINT
%token MEDIUMTEXT
%token MEDIUM_SYM
+%token MEMORY_SYM
%token MERGE_SYM
%token MICROSECOND_SYM
%token MIGRATE_SYM
@@ -460,6 +469,7 @@
%token NOT_SYM
%token NOW_SYM
%token NO_SYM
+%token NO_WAIT_SYM
%token NO_WRITE_TO_BINLOG
%token NULL_SYM
%token NUM
@@ -516,9 +526,13 @@
%token RAND
%token RANGE_SYM
%token READS_SYM
+%token READ_ONLY_SYM
%token READ_SYM
+%token READ_WRITE_SYM
%token REAL
%token RECOVER_SYM
+%token REDO_BUFFER_SIZE_SYM
+%token REDOFILE_SYM
%token REDUNDANT_SYM
%token REFERENCES
%token REGEXP
@@ -642,6 +656,8 @@
%token ULONGLONG_NUM
%token UNCOMMITTED_SYM
%token UNDEFINED_SYM
+%token UNDO_BUFFER_SIZE_SYM
+%token UNDOFILE_SYM
%token UNDERSCORE_CHARSET
%token UNDO_SYM
%token UNICODE_SYM
@@ -672,6 +688,7 @@
%token VARIANCE_SYM
%token VARYING
%token VIEW_SYM
+%token WAIT_SYM
%token WARNINGS
%token WEEK_SYM
%token WHEN_SYM
@@ -740,7 +757,7 @@
ulong_num raid_types merge_insert_types
%type <ulonglong_number>
- ulonglong_num
+ ulonglong_num size_number
%type <longlong_number>
part_bit_expr
@@ -1307,18 +1324,6 @@
YYTHD->client_capabilities |= $<ulong_num>4;
sp->restore_thd_mem_root(YYTHD);
}
- | CREATE
- {
- Lex->create_view_mode= VIEW_CREATE_NEW;
- Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
- Lex->create_view_suid= TRUE;
- }
- view_or_trigger
- {}
- | CREATE USER clear_privileges grant_list
- {
- Lex->sql_command = SQLCOM_CREATE_USER;
- }
| CREATE EVENT_SYM opt_if_not_exists sp_name
/*
BE CAREFUL when you add a new rule to update the block where
@@ -1376,90 +1381,29 @@
*/
Lex->sql_command= SQLCOM_CREATE_EVENT;
}
- ;
-
-ev_schedule_time: EVERY_SYM expr interval
+ | CREATE
{
- LEX *lex=Lex;
- if (!lex->et_compile_phase)
- {
- switch (lex->et->init_interval(YYTHD , $2, $3)) {
- case EVEX_PARSE_ERROR:
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- break;
- case EVEX_BAD_PARAMS:
- my_error(ER_EVENT_INTERVAL_NOT_POSITIVE, MYF(0));
- YYABORT;
- break;
- }
- }
- }
- ev_starts
- ev_ends
- | AT_SYM expr
- {
- LEX *lex=Lex;
- if (!lex->et_compile_phase)
- {
- switch (lex->et->init_execute_at(YYTHD, $2)) {
- case EVEX_PARSE_ERROR:
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- break;
- case EVEX_BAD_PARAMS:
- my_error(ER_EVENT_EXEC_TIME_IN_THE_PAST, MYF(0));
- YYABORT;
- break;
- }
- }
- }
- ;
-
-ev_status: /* empty */ {$<ulong_num>$= 0;}
- | ENABLED_SYM
- {
- LEX *lex=Lex;
- if (!lex->et_compile_phase)
- lex->et->status= MYSQL_EVENT_ENABLED;
- $<ulong_num>$= 1;
- }
- | DISABLED_SYM
- {
- LEX *lex=Lex;
-
- if (!lex->et_compile_phase)
- lex->et->status= MYSQL_EVENT_DISABLED;
- $<ulong_num>$= 1;
+ Lex->create_view_mode= VIEW_CREATE_NEW;
+ Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
+ Lex->create_view_suid= TRUE;
+ }
+ view_or_trigger
+ {}
+ | CREATE USER clear_privileges grant_list
+ {
+ Lex->sql_command = SQLCOM_CREATE_USER;
}
- ;
-ev_starts: /* empty */
- | STARTS_SYM expr
+ | CREATE LOGFILE_SYM GROUP logfile_group_info
{
LEX *lex= Lex;
- if (!lex->et_compile_phase)
- lex->et->init_starts(YYTHD, $2);
+ lex->alter_tablespace_info->ts_cmd_type= CREATE_LOGFILE_GROUP;
}
- ;
-ev_ends: /* empty */
- | ENDS_SYM expr
+ | CREATE TABLESPACE tablespace_info
{
LEX *lex= Lex;
- if (!lex->et_compile_phase)
- {
- switch (lex->et->init_ends(YYTHD, $2)) {
- case EVEX_PARSE_ERROR:
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- break;
- case EVEX_BAD_PARAMS:
- my_error(ER_EVENT_ENDS_BEFORE_STARTS, MYF(0));
- YYABORT;
- break;
- }
- }
+ lex->alter_tablespace_info->ts_cmd_type= CREATE_TABLESPACE;
}
- ;
+ ;
ev_on_completion: /* empty */ {$<ulong_num>$= 0;}
| ON COMPLETION_SYM PRESERVE_SYM
{
@@ -2849,6 +2793,382 @@
| DELETE_SYM
{ Lex->trg_chistics.event= TRG_EVENT_DELETE; }
;
+/*
+ This part of the parser contains common code for all TABLESPACE
+ commands.
+ CREATE TABLESPACE name ...
+ ALTER TABLESPACE name CHANGE DATAFILE ...
+ ALTER TABLESPACE name ADD DATAFILE ...
+ ALTER TABLESPACE name access_mode
+ CREATE LOGFILE GROUP name ...
+ ALTER LOGFILE GROUP name ADD UNDOFILE ..
+ ALTER LOGFILE GROUP name ADD REDOFILE ..
+ DROP TABLESPACE name
+ DROP LOGFILE GROUP name
+*/
+change_tablespace_access:
+ tablespace_name
+ ts_access_mode
+ ;
+
+change_tablespace_info:
+ tablespace_name
+ CHANGE ts_datafile
+ change_ts_option_list
+ ;
+
+tablespace_info:
+ tablespace_name
+ ADD ts_datafile
+ opt_logfile_group_name
+ tablespace_option_list
+ ;
+
+opt_logfile_group_name:
+ /* empty */ {}
+ | USE_SYM LOGFILE_SYM GROUP ident
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->logfile_group_name= $4.str;
+ };
+
+alter_tablespace_info:
+ tablespace_name
+ ADD ts_datafile
+ alter_tablespace_option_list
+ {
+ Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_ADD_FILE;
+ }
+ |
+ tablespace_name
+ DROP ts_datafile
+ alter_tablespace_option_list
+ {
+ Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_DROP_FILE;
+ };
+
+logfile_group_info:
+ logfile_group_name
+ add_log_file
+ logfile_group_option_list
+ ;
+
+alter_logfile_group_info:
+ logfile_group_name
+ add_log_file
+ alter_logfile_group_option_list
+ ;
+
+add_log_file:
+ ADD lg_undofile
+ | ADD lg_redofile
+ ;
+
+change_ts_option_list:
+ /* empty */ {}
+ change_ts_options
+ ;
+
+change_ts_options:
+ change_ts_option
+ | change_ts_options change_ts_option
+ | change_ts_options ',' change_ts_option
+ ;
+
+change_ts_option:
+ opt_ts_initial_size
+ | opt_ts_autoextend_size
+ | opt_ts_max_size
+ ;
+
+tablespace_option_list:
+ /* empty */ {}
+ tablespace_options
+ ;
+
+tablespace_options:
+ tablespace_option
+ | tablespace_options tablespace_option
+ | tablespace_options ',' tablespace_option
+ ;
+
+tablespace_option:
+ opt_ts_initial_size
+ | opt_ts_autoextend_size
+ | opt_ts_max_size
+ | opt_ts_extent_size
+ | opt_ts_nodegroup
+ | opt_ts_engine
+ | ts_wait
+ | opt_ts_comment
+ ;
+
+alter_tablespace_option_list:
+ /* empty */ {}
+ alter_tablespace_options
+ ;
+
+alter_tablespace_options:
+ alter_tablespace_option
+ | alter_tablespace_options alter_tablespace_option
+ | alter_tablespace_options ',' alter_tablespace_option
+ ;
+
+alter_tablespace_option:
+ opt_ts_initial_size
+ | opt_ts_autoextend_size
+ | opt_ts_max_size
+ | opt_ts_engine
+ | ts_wait
+ ;
+
+logfile_group_option_list:
+ /* empty */ {}
+ logfile_group_options
+ ;
+
+logfile_group_options:
+ logfile_group_option
+ | logfile_group_options logfile_group_option
+ | logfile_group_options ',' logfile_group_option
+ ;
+
+logfile_group_option:
+ opt_ts_initial_size
+ | opt_ts_undo_buffer_size
+ | opt_ts_redo_buffer_size
+ | opt_ts_nodegroup
+ | opt_ts_engine
+ | ts_wait
+ | opt_ts_comment
+ ;
+
+alter_logfile_group_option_list:
+ /* empty */ {}
+ alter_logfile_group_options
+ ;
+
+alter_logfile_group_options:
+ alter_logfile_group_option
+ | alter_logfile_group_options alter_logfile_group_option
+ | alter_logfile_group_options ',' alter_logfile_group_option
+ ;
+
+alter_logfile_group_option:
+ opt_ts_initial_size
+ | opt_ts_engine
+ | ts_wait
+ ;
+
+
+ts_datafile:
+ DATAFILE_SYM TEXT_STRING_sys
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->data_file_name= $2.str;
+ };
+
+lg_undofile:
+ UNDOFILE_SYM TEXT_STRING_sys
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->undo_file_name= $2.str;
+ };
+
+lg_redofile:
+ REDOFILE_SYM TEXT_STRING_sys
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->redo_file_name= $2.str;
+ };
+
+tablespace_name:
+ ident
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info= new st_alter_tablespace();
+ lex->alter_tablespace_info->tablespace_name= $1.str;
+ lex->sql_command= SQLCOM_ALTER_TABLESPACE;
+ };
+
+logfile_group_name:
+ ident
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info= new st_alter_tablespace();
+ lex->alter_tablespace_info->logfile_group_name= $1.str;
+ lex->sql_command= SQLCOM_ALTER_TABLESPACE;
+ };
+
+ts_access_mode:
+ READ_ONLY_SYM
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_access_mode= TS_READ_ONLY;
+ }
+ | READ_WRITE_SYM
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_access_mode= TS_READ_WRITE;
+ }
+ | NOT_SYM ACCESSIBLE_SYM
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_access_mode= TS_NOT_ACCESSIBLE;
+ };
+
+opt_ts_initial_size:
+ INITIAL_SIZE_SYM opt_equal size_number
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->initial_size= $3;
+ };
+
+opt_ts_autoextend_size:
+ AUTOEXTEND_SIZE_SYM opt_equal size_number
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->autoextend_size= $3;
+ };
+
+opt_ts_max_size:
+ MAX_SIZE_SYM opt_equal size_number
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->max_size= $3;
+ };
+
+opt_ts_extent_size:
+ EXTENT_SIZE_SYM opt_equal size_number
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->extent_size= $3;
+ };
+
+opt_ts_undo_buffer_size:
+ UNDO_BUFFER_SIZE_SYM opt_equal size_number
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->undo_buffer_size= $3;
+ };
+
+opt_ts_redo_buffer_size:
+ REDO_BUFFER_SIZE_SYM opt_equal size_number
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->redo_buffer_size= $3;
+ };
+
+opt_ts_nodegroup:
+ NODEGROUP_SYM opt_equal ulong_num
+ {
+ LEX *lex= Lex;
+ if (lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP)
+ {
+ my_error(ER_TABLESPACE_OPTION_ONLY_ONCE,MYF(0),"NODEGROUP");
+ YYABORT;
+ }
+ lex->alter_tablespace_info->nodegroup_id= $3;
+ };
+
+opt_ts_comment:
+ COMMENT_SYM opt_equal TEXT_STRING_sys
+ {
+ LEX *lex= Lex;
+ if (lex->alter_tablespace_info->ts_comment != NULL)
+ {
+ my_error(ER_TABLESPACE_OPTION_ONLY_ONCE,MYF(0),"COMMENT");
+ YYABORT;
+ }
+ lex->alter_tablespace_info->ts_comment= $3.str;
+ };
+
+opt_ts_engine:
+ opt_storage ENGINE_SYM opt_equal storage_engines
+ {
+ LEX *lex= Lex;
+ if (lex->alter_tablespace_info->storage_engine != DB_TYPE_UNKNOWN)
+ {
+ my_error(ER_TABLESPACE_OPTION_ONLY_ONCE,MYF(0),
+ "STORAGE ENGINE");
+ YYABORT;
+ }
+ lex->alter_tablespace_info->storage_engine= $4->db_type;
+ };
+
+opt_ts_wait:
+ /* empty */
+ | ts_wait
+ ;
+
+ts_wait:
+ WAIT_SYM
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->wait_until_completed= TRUE;
+ }
+ | NO_WAIT_SYM
+ {
+ LEX *lex= Lex;
+ if (!(lex->alter_tablespace_info->wait_until_completed))
+ {
+ my_error(ER_TABLESPACE_OPTION_ONLY_ONCE,MYF(0),"NO_WAIT");
+ YYABORT;
+ }
+ lex->alter_tablespace_info->wait_until_completed= FALSE;
+ };
+
+size_number:
+ ulong_num { $$= $1;}
+ | IDENT
+ {
+ ulonglong number, test_number;
+ uint text_shift_number= 0;
+ longlong prefix_number;
+ char *end_ptr;
+ char *start_ptr= $1.str;
+ uint str_len= strlen(start_ptr);
+ int error;
+ prefix_number= my_strtoll10(start_ptr, &end_ptr, &error);
+ if ((start_ptr + str_len - 1) == end_ptr)
+ {
+ switch (end_ptr[0])
+ {
+ case 'g':
+ case 'G':
+ text_shift_number+=10;
+ case 'm':
+ case 'M':
+ text_shift_number+=10;
+ case 'k':
+ case 'K':
+ text_shift_number+=10;
+ break;
+ default:
+ {
+ my_error(ER_WRONG_SIZE_NUMBER, MYF(0));
+ YYABORT;
+ }
+ }
+ if (prefix_number >> 31)
+ {
+ my_error(ER_SIZE_OVERFLOW_ERROR, MYF(0));
+ YYABORT;
+ }
+ number= prefix_number << text_shift_number;
+ }
+ else
+ {
+ my_error(ER_WRONG_SIZE_NUMBER, MYF(0));
+ YYABORT;
+ }
+ $$= number;
+ }
+ ;
+
+/*
+ End tablespace part
+*/
create2:
'(' create2a {}
@@ -3507,6 +3827,9 @@
| INSERT_METHOD opt_equal merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;}
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.data_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; }
| INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.index_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; }
+ | TABLESPACE ident {Lex->create_info.tablespace= $2.str;}
+ | STORAGE_SYM DISK_SYM {Lex->create_info.store_on_disk= TRUE;}
+ | STORAGE_SYM MEMORY_SYM {Lex->create_info.store_on_disk= FALSE;}
| CONNECTION_SYM opt_equal TEXT_STRING_sys { Lex->create_info.connect_string.str= $3.str; Lex->create_info.connect_string.length= $3.length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; }
;
@@ -4326,8 +4649,28 @@
YYABORT;
}
Lex->sql_command= SQLCOM_ALTER_EVENT;
- }
- ;
+ }
+ | ALTER TABLESPACE alter_tablespace_info
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_cmd_type= ALTER_TABLESPACE;
+ }
+ | ALTER LOGFILE_SYM GROUP alter_logfile_group_info
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_cmd_type= ALTER_LOGFILE_GROUP;
+ }
+ | ALTER TABLESPACE change_tablespace_info
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_cmd_type= CHANGE_FILE_TABLESPACE;
+ }
+ | ALTER TABLESPACE change_tablespace_access
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_cmd_type= ALTER_ACCESS_MODE_TABLESPACE;
+ }
+ ;
ev_on_schedule: /* empty */ { $<ulong_num>$= 0;}
| ON SCHEDULE_SYM ev_schedule_time
@@ -4346,12 +4689,6 @@
}
;
-ev_opt_sql_stmt: /* empty*/ { $<ulong_num>$= 0;}
- | DO_SYM ev_sql_stmt
- {
- $<ulong_num>$= 1;
- }
- ;
ident_or_empty:
/* empty */ { $$= 0; }
@@ -7044,12 +7381,6 @@
lex->sql_command= SQLCOM_DROP_VIEW;
lex->drop_if_exists= $3;
}
- | DROP TRIGGER_SYM sp_name
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_DROP_TRIGGER;
- lex->spname= $3;
- }
| DROP EVENT_SYM if_exists sp_name
{
LEX *lex=Lex;
@@ -7072,7 +7403,23 @@
lex->sql_command = SQLCOM_DROP_EVENT;
lex->drop_if_exists= $3;
}
- ;
+ | DROP TRIGGER_SYM sp_name
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_DROP_TRIGGER;
+ lex->spname= $3;
+ }
+ | DROP TABLESPACE tablespace_name opt_ts_engine opt_ts_wait
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_cmd_type= DROP_TABLESPACE;
+ }
+ | DROP LOGFILE_SYM GROUP logfile_group_name opt_ts_engine opt_ts_wait
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP;
+ }
+ ;
table_list:
table_name
@@ -8529,6 +8876,12 @@
ident:
IDENT_sys { $$=$1; }
+ | READ_ONLY_SYM
+ {
+ THD *thd= YYTHD;
+ $$.str= thd->strmake("read_only",9);
+ $$.length= 9;
+ }
| keyword
{
THD *thd= YYTHD;
@@ -8652,6 +9005,7 @@
| ANY_SYM {}
| AT_SYM {}
| AUTO_INC {}
+ | AUTOEXTEND_SIZE_SYM {}
| AVG_ROW_LENGTH {}
| AVG_SYM {}
| BERKELEY_DB_SYM {}
@@ -8677,6 +9031,7 @@
| CONSISTENT_SYM {}
| CUBE_SYM {}
| DATA_SYM {}
+ | DATAFILE_SYM {}
| DATETIME {}
| DATE_SYM {}
| DAY_SYM {}
@@ -8686,6 +9041,7 @@
| DIRECTORY_SYM {}
| DISABLED_SYM {}
| DISCARD {}
+ | DISK_SYM {}
| DUMPFILE {}
| DUPLICATE_SYM {}
| DYNAMIC_SYM {}
@@ -8700,6 +9056,7 @@
| EVERY_SYM {}
| EXPANSION_SYM {}
| EXTENDED_SYM {}
+ | EXTENT_SIZE_SYM {}
| FAST_SYM {}
| FOUND_SYM {}
| DISABLE_SYM {}
@@ -8722,6 +9079,7 @@
| INVOKER_SYM {}
| IMPORT {}
| INDEXES {}
+ | INITIAL_SIZE_SYM {}
| ISOLATION {}
| ISSUER_SYM {}
| INNOBASE_SYM {}
@@ -8735,6 +9093,7 @@
| LIST_SYM {}
| LOCAL_SYM {}
| LOCKS_SYM {}
+ | LOGFILE_SYM {}
| LOGS_SYM {}
| MAX_ROWS {}
| MASTER_SYM {}
@@ -8754,10 +9113,12 @@
| MASTER_SSL_KEY_SYM {}
| MAX_CONNECTIONS_PER_HOUR {}
| MAX_QUERIES_PER_HOUR {}
+ | MAX_SIZE_SYM {}
| MAX_UPDATES_PER_HOUR {}
| MAX_USER_CONNECTIONS_SYM {}
| MAX_VALUE_SYM {}
| MEDIUM_SYM {}
+ | MEMORY_SYM {}
| MERGE_SYM {}
| MICROSECOND_SYM {}
| MIGRATE_SYM {}
@@ -8777,7 +9138,8 @@
| NDBCLUSTER_SYM {}
| NEXT_SYM {}
| NEW_SYM {}
- | NODEGROUP_SYM {}
+ | NO_WAIT_SYM {}
+ | NODEGROUP_SYM {}
| NONE_SYM {}
| NVARCHAR_SYM {}
| OFFSET_SYM {}
@@ -8805,6 +9167,8 @@
| RAID_STRIPED_SYM {}
| RAID_TYPE {}
| RECOVER_SYM {}
+ | REDO_BUFFER_SIZE_SYM {}
+ | REDOFILE_SYM {}
| REDUNDANT_SYM {}
| RELAY_LOG_FILE_SYM {}
| RELAY_LOG_POS_SYM {}
@@ -8863,6 +9227,8 @@
| FUNCTION_SYM {}
| UNCOMMITTED_SYM {}
| UNDEFINED_SYM {}
+ | UNDO_BUFFER_SIZE_SYM {}
+ | UNDOFILE_SYM {}
| UNKNOWN_SYM {}
| UNTIL_SYM {}
| USER {}
@@ -8871,6 +9237,7 @@
| VIEW_SYM {}
| VALUE_SYM {}
| WARNINGS {}
+ | WAIT_SYM {}
| WEEK_SYM {}
| WORK_SYM {}
| X509_SYM {}
--- 1.68/sql/share/errmsg.txt 2006-01-10 21:46:56 +01:00
+++ 1.69/sql/share/errmsg.txt 2006-01-11 12:01:29 +01:00
@@ -5727,41 +5727,23 @@
eng "Incorrect %-.32s value: '%-.128s'"
ER_NO_PARTITION_FOR_GIVEN_VALUE
eng "Table has no partition for value %ld"
+ER_TABLESPACE_OPTION_ONLY_ONCE
+ eng "It is not allowed to specify %s more than once"
+ER_CREATE_TABLESPACE_FAILED
+ eng "Failed to create %s"
+ER_DROP_TABLESPACE_FAILED
+ eng "Failed to drop %s"
+ER_TABLESPACE_AUTO_EXTEND_ERROR
+ eng "The handler doesn't support autoextend of tablespaces"
+ER_WRONG_SIZE_NUMBER
+ eng "A size parameter was incorrectly specified, either number or on the form 10M"
+ER_SIZE_OVERFLOW_ERROR
+ eng "The size number was correct but we don't allow the digit part to be more than 2 billion"
+ER_ALTER_TABLESPACE_FAILED
+ eng "Failed to alter: %s"
ER_BINLOG_ROW_LOGGING_FAILED
eng "Writing one row to the row-based binary log failed"
ER_BINLOG_ROW_WRONG_TABLE_DEF
eng "Table definition on master and slave does not match"
ER_BINLOG_ROW_RBR_TO_SBR
eng "Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events"
-ER_EVENT_ALREADY_EXISTS
- eng "Event '%-.64s' already exists"
-ER_EVENT_STORE_FAILED
- eng "Failed to store event %s. Error code %d from storage engine."
-ER_EVENT_DOES_NOT_EXIST
- eng "Unknown event '%-.64s'"
-ER_EVENT_CANT_ALTER
- eng "Failed to alter event '%-.64s'"
-ER_EVENT_DROP_FAILED
- eng "Failed to drop %s"
-ER_EVENT_INTERVAL_NOT_POSITIVE
- eng "INTERVAL must be positive"
-ER_EVENT_ENDS_BEFORE_STARTS
- eng "ENDS must be after STARTS"
-ER_EVENT_EXEC_TIME_IN_THE_PAST
- eng "Activation (AT) time is in the past"
-ER_EVENT_OPEN_TABLE_FAILED
- eng "Failed to open mysql.event"
-ER_EVENT_NEITHER_M_EXPR_NOR_M_AT
- eng "No datetime expression provided"
-ER_EVENT_COL_COUNT_DOESNT_MATCH
- eng "Column count of %s.%s is wrong. Table probably corrupted"
-ER_EVENT_CANNOT_LOAD_FROM_TABLE
- eng "Cannot load from mysql.event. Table probably corrupted"
-ER_EVENT_CANNOT_DELETE
- eng "Failed to delete the event from mysql.event"
-ER_EVENT_COMPILE_ERROR
- eng "Error during compilation of event's body"
-ER_EVENT_SAME_NAME
- eng "Same old and new event name"
-ER_EVENT_DATA_TOO_LONG
- eng "Data for column '%s' too long"
--- 1.75/libmysqld/Makefile.am 2006-01-10 21:02:08 +01:00
+++ 1.76/libmysqld/Makefile.am 2006-01-11 12:01:29 +01:00
@@ -63,8 +63,10 @@
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
- parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc event_executor.cc event.cc event_timed.cc \
- rpl_filter.cc sql_partition.cc handlerton.cc sql_plugin.cc
+ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
+ event_executor.cc event.cc event_timed.cc \
+ rpl_filter.cc sql_partition.cc handlerton.cc sql_plugin.cc \
+ sql_tablespace.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
EXTRA_libmysqld_a_SOURCES = ha_innodb.cc ha_berkeley.cc ha_archive.cc \
| Thread |
|---|
| • bk commit into 5.1 tree (andrey:1.2029) | ahristov | 11 Jan |