Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas 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.1943 05/10/26 22:27:06 jonas@stripped +2 -0
Merge perch.ndb.mysql.com:/home/jonas/src/51-push
into perch.ndb.mysql.com:/home/jonas/src/51-dd
sql/sql_yacc.yy
1.422 05/10/26 22:27:02 jonas@stripped +0 -0
Auto merged
sql/mysql_priv.h
1.344 05/10/26 22:27:02 jonas@stripped +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: jonas
# Host: perch.ndb.mysql.com
# Root: /home/jonas/src/51-dd/RESYNC
--- 1.343/sql/mysql_priv.h 2005-10-26 05:19:19 +02:00
+++ 1.344/sql/mysql_priv.h 2005-10-26 22:27:02 +02:00
@@ -675,6 +675,7 @@
bool mysql_xa_recover(THD *thd);
bool check_simple_select();
+int mysql_alter_tablespace(st_alter_tablespace *ts_info);
SORT_FIELD * make_unireg_sortorder(ORDER *order, uint *length);
int setup_order(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
--- 1.421/sql/sql_yacc.yy 2005-10-26 05:19:20 +02:00
+++ 1.422/sql/sql_yacc.yy 2005-10-26 22:27:02 +02:00
@@ -120,6 +120,7 @@
%token END_OF_INPUT
%token ABORT_SYM
+%token ACCESSIBLE_SYM
%token ACTION
%token ADD
%token ADDDATE_SYM
@@ -139,6 +140,7 @@
%token ASENSITIVE_SYM
%token ATAN
%token AUTO_INC
+%token AUTOEXTEND_SIZE_SYM
%token AVG_ROW_LENGTH
%token AVG_SYM
%token BACKUP_SYM
@@ -207,6 +209,7 @@
%token CURTIME
%token DATABASE
%token DATABASES
+%token DATAFILE_SYM
%token DATA_SYM
%token DATETIME
%token DATE_ADD_INTERVAL
@@ -236,6 +239,7 @@
%token DIRECTORY_SYM
%token DISABLE_SYM
%token DISCARD
+%token DISK_SYM
%token DISTINCT
%token DIV_SYM
%token DOUBLE_SYM
@@ -268,6 +272,7 @@
%token EXPANSION_SYM
%token EXPORT_SET
%token EXTENDED_SYM
+%token EXTENT_SIZE_SYM
%token EXTRACT_SYM
%token FALSE_SYM
%token FAST_SYM
@@ -330,6 +335,7 @@
%token INDEXES
%token INDEX_SYM
%token INFILE
+%token INITIAL_SIZE_SYM
%token INNER_SYM
%token INNOBASE_SYM
%token INOUT_SYM
@@ -376,6 +382,7 @@
%token LOCATOR_SYM
%token LOCKS_SYM
%token LOCK_SYM
+%token LOGFILE_SYM
%token LOGS_SYM
%token LOG_SYM
%token LONGBLOB
@@ -406,6 +413,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
@@ -414,6 +422,7 @@
%token MEDIUMINT
%token MEDIUMTEXT
%token MEDIUM_SYM
+%token MEMORY_SYM
%token MERGE_SYM
%token MICROSECOND_SYM
%token MIGRATE_SYM
@@ -450,6 +459,7 @@
%token NOT_SYM
%token NOW_SYM
%token NO_SYM
+%token NO_WAIT_SYM
%token NO_WRITE_TO_BINLOG
%token NULL_SYM
%token NUM
@@ -505,9 +515,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
@@ -629,6 +643,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
@@ -659,6 +675,7 @@
%token VARIANCE_SYM
%token VARYING
%token VIEW_SYM
+%token WAIT_SYM
%token WARNINGS
%token WEEK_SYM
%token WHEN_SYM
@@ -726,7 +743,7 @@
ulong_num raid_types merge_insert_types
%type <ulonglong_number>
- ulonglong_num
+ ulonglong_num size_number
%type <longlong_number>
part_bit_expr
@@ -1298,6 +1315,16 @@
}
opt_view_list AS select_view_init check_option
{}
+ | CREATE LOGFILE_SYM GROUP logfile_group_info
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_cmd_type= CREATE_LOGFILE_GROUP;
+ }
+ | CREATE TABLESPACE tablespace_info
+ {
+ LEX *lex= Lex;
+ lex->alter_tablespace_info->ts_cmd_type= CREATE_TABLESPACE;
+ }
| CREATE TRIGGER_SYM sp_name trg_action_time trg_event
ON table_ident FOR_SYM EACH_SYM ROW_SYM
{
@@ -2559,6 +2586,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;
+ };
+
+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 {}
@@ -3205,6 +3608,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; }
;
@@ -3966,6 +4372,26 @@
}
opt_view_list AS select_view_init check_option
{}
+ | 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;
+ }
;
ident_or_empty:
@@ -6692,6 +7118,16 @@
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;
}
;
@@ -8202,6 +8638,7 @@
| ALGORITHM_SYM {}
| ANY_SYM {}
| AUTO_INC {}
+ | AUTOEXTEND_SIZE_SYM {}
| AVG_ROW_LENGTH {}
| AVG_SYM {}
| BERKELEY_DB_SYM {}
@@ -8225,6 +8662,7 @@
| CONSISTENT_SYM {}
| CUBE_SYM {}
| DATA_SYM {}
+ | DATAFILE_SYM {}
| DATETIME {}
| DATE_SYM {}
| DAY_SYM {}
@@ -8233,6 +8671,7 @@
| DES_KEY_FILE {}
| DIRECTORY_SYM {}
| DISCARD {}
+ | DISK_SYM {}
| DUMPFILE {}
| DUPLICATE_SYM {}
| DYNAMIC_SYM {}
@@ -8244,6 +8683,7 @@
| EVENTS_SYM {}
| EXPANSION_SYM {}
| EXTENDED_SYM {}
+ | EXTENT_SIZE_SYM {}
| FAST_SYM {}
| FOUND_SYM {}
| DISABLE_SYM {}
@@ -8265,6 +8705,7 @@
| INVOKER_SYM {}
| IMPORT {}
| INDEXES {}
+ | INITIAL_SIZE_SYM {}
| ISOLATION {}
| ISSUER_SYM {}
| INNOBASE_SYM {}
@@ -8278,6 +8719,7 @@
| LIST_SYM {}
| LOCAL_SYM {}
| LOCKS_SYM {}
+ | LOGFILE_SYM {}
| LOGS_SYM {}
| MAX_ROWS {}
| MASTER_SYM {}
@@ -8297,10 +8739,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 {}
@@ -8320,7 +8764,8 @@
| NDBCLUSTER_SYM {}
| NEXT_SYM {}
| NEW_SYM {}
- | NODEGROUP_SYM {}
+ | NO_WAIT_SYM {}
+ | NODEGROUP_SYM {}
| NONE_SYM {}
| NVARCHAR_SYM {}
| OFFSET_SYM {}
@@ -8347,6 +8792,8 @@
| RAID_STRIPED_SYM {}
| RAID_TYPE {}
| RECOVER_SYM {}
+ | REDO_BUFFER_SIZE_SYM {}
+ | REDOFILE_SYM {}
| REDUNDANT_SYM {}
| RELAY_LOG_FILE_SYM {}
| RELAY_LOG_POS_SYM {}
@@ -8403,6 +8850,8 @@
| FUNCTION_SYM {}
| UNCOMMITTED_SYM {}
| UNDEFINED_SYM {}
+ | UNDO_BUFFER_SIZE_SYM {}
+ | UNDOFILE_SYM {}
| UNKNOWN_SYM {}
| UNTIL_SYM {}
| USER {}
@@ -8411,6 +8860,7 @@
| VIEW_SYM {}
| VALUE_SYM {}
| WARNINGS {}
+ | WAIT_SYM {}
| WEEK_SYM {}
| WORK_SYM {}
| X509_SYM {}
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.1943) | jonas | 26 Oct |