Below is the list of changes that have just been committed into a local
5.1 repository of marty. When marty 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@stripped, 2007-08-09 00:13:49+02:00, mskold@stripped +7 -0
Changed ONLINE ALTER syntax to
ALTER [ONLINE|OFFLINE] TABLE ...
CREATE [ONLINE|OFFLINE] INDEX ...
DROP [ONLINE|OFFLINE] INDEX ...
include/my_base.h@stripped, 2007-08-09 00:13:40+02:00, mskold@stripped +8 -0
Build method enum for alter_info
mysql-test/r/ndb_alter_table_online.result@stripped, 2007-08-09 00:13:41+02:00,
mskold@stripped +8 -8
Regenerated result after syntax change
mysql-test/t/ndb_alter_table_online.test@stripped, 2007-08-09 00:13:42+02:00,
mskold@stripped +4 -4
Syntax change
sql/lex.h@stripped, 2007-08-09 00:13:42+02:00, mskold@stripped +0 -1
Removed ONLY symbol
sql/sql_lex.h@stripped, 2007-08-09 00:13:42+02:00, mskold@stripped +2 -6
Moved enum declaration to include/my_base.h
sql/sql_table.cc@stripped, 2007-08-09 00:13:42+02:00, mskold@stripped +2 -2
Changed name of build_methods
sql/sql_yacc.yy@stripped, 2007-08-09 00:13:42+02:00, mskold@stripped +23 -27
Changed ONLINE ALTER syntax to
ALTER [ONLINE|OFFLINE] TABLE ...
CREATE [ONLINE|OFFLINE] INDEX ...
DROP [ONLINE|OFFLINE] INDEX ...
# 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: mskold
# Host: linux.site
# Root: /windows/Linux_space/MySQL/mysql-5.1-telco-6.2
--- 1.100/include/my_base.h 2007-08-09 00:14:10 +02:00
+++ 1.101/include/my_base.h 2007-08-09 00:14:10 +02:00
@@ -96,6 +96,14 @@ enum ha_key_alg {
HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */
};
+ /* Index and table build methods */
+
+enum ha_build_method {
+ HA_BUILD_DEFAULT,
+ HA_BUILD_ONLINE,
+ HA_BUILD_OFFLINE
+};
+
/* Storage media types */
enum ha_storage_media {
--- 1.176/sql/lex.h 2007-08-09 00:14:10 +02:00
+++ 1.177/sql/lex.h 2007-08-09 00:14:10 +02:00
@@ -369,7 +369,6 @@ static SYMBOL symbols[] = {
{ "ON", SYM(ON)},
{ "ONE", SYM(ONE_SYM)},
{ "ONLINE", SYM(ONLINE_SYM)},
- { "ONLY", SYM(ONLY_SYM)},
{ "ONE_SHOT", SYM(ONE_SHOT_SYM)},
{ "OPEN", SYM(OPEN_SYM)},
{ "OPTIMIZE", SYM(OPTIMIZE)},
--- 1.279/sql/sql_lex.h 2007-08-09 00:14:10 +02:00
+++ 1.280/sql/sql_lex.h 2007-08-09 00:14:10 +02:00
@@ -835,10 +835,6 @@ inline bool st_select_lex_unit::is_union
#define ALTER_REMOVE_PARTITIONING (1L << 30)
#define ALTER_FOREIGN_KEY (1L << 31)
-enum enum_build_method { BUILD_METHOD_DEFAULT,
- BUILD_METHOD_ONLINE,
- BUILD_METHOD_OFFLINE };
-
typedef struct st_alter_info
{
List<Alter_drop> drop_list;
@@ -848,7 +844,7 @@ typedef struct st_alter_info
enum tablespace_op_type tablespace_op;
List<char> partition_names;
uint no_parts;
- enum enum_build_method build_method;
+ enum ha_build_method build_method;
st_alter_info(){clear();}
void clear()
@@ -857,7 +853,7 @@ typedef struct st_alter_info
tablespace_op= NO_TABLESPACE_OP;
no_parts= 0;
partition_names.empty();
- build_method= BUILD_METHOD_DEFAULT;
+ build_method= HA_BUILD_DEFAULT;
}
void reset(){drop_list.empty();alter_list.empty();clear();}
} ALTER_INFO;
--- 1.422/sql/sql_table.cc 2007-08-09 00:14:10 +02:00
+++ 1.423/sql/sql_table.cc 2007-08-09 00:14:10 +02:00
@@ -6522,7 +6522,7 @@ view_err:
If no table rename,
check if table can be altered on-line
*/
- if (alter_info->build_method != BUILD_METHOD_OFFLINE)
+ if (alter_info->build_method != HA_BUILD_OFFLINE)
{
if (!(altered_table= create_altered_table(thd,
table,
@@ -6537,7 +6537,7 @@ view_err:
&alter_table_flags,
table_changes)) {
case(HA_ALTER_NOT_SUPPORTED):
- if (alter_info->build_method == BUILD_METHOD_ONLINE)
+ if (alter_info->build_method == HA_BUILD_ONLINE)
{
my_error(ER_NOT_SUPPORTED_YET, MYF(0), thd->query);
goto err;
--- 1.572/sql/sql_yacc.yy 2007-08-09 00:14:10 +02:00
+++ 1.573/sql/sql_yacc.yy 2007-08-09 00:14:10 +02:00
@@ -484,6 +484,7 @@ Item* handle_sql2003_note184_exception(T
sp_head *sphead;
struct p_elem_val *p_elem_value;
enum index_hint_type index_hint;
+ enum ha_build_method build_method;
}
%{
@@ -492,10 +493,10 @@ bool my_yyoverflow(short **a, YYSTYPE **
%pure_parser /* We have threads */
/*
- Currently there is 292 shift/reduce conflict. We should not introduce
+ Currently there is 286 shift/reduce conflict. We should not introduce
new conflicts any more.
*/
-%expect 292
+%expect 286
/*
Comments for TOKENS.
@@ -847,7 +848,6 @@ bool my_yyoverflow(short **a, YYSTYPE **
%token ONE_SHOT_SYM
%token ONE_SYM
%token ONLINE_SYM
-%token ONLY_SYM
%token OPEN_SYM /* SQL-2003-R */
%token OPTIMIZE
%token OPTIONS_SYM
@@ -1220,6 +1220,8 @@ bool my_yyoverflow(short **a, YYSTYPE **
%type <boolfunc2creator> comp_op
+%type <build_method> build_method
+
%type <NONE>
query verb_clause create change select do drop insert replace insert2
insert_values update delete truncate rename
@@ -1602,12 +1604,13 @@ create:
$5->table.str);
}
}
- | CREATE opt_unique_or_fulltext INDEX_SYM ident key_alg ON
- table_ident build_method
+ | CREATE build_method opt_unique_or_fulltext INDEX_SYM ident key_alg
+ ON table_ident
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_CREATE_INDEX;
- if (!lex->current_select->add_table_to_list(lex->thd, $7,
+ lex->alter_info.build_method= $2;
+ if (!lex->current_select->add_table_to_list(lex->thd, $8,
NULL,
TL_OPTION_UPDATING))
MYSQL_YYABORT;
@@ -1619,12 +1622,12 @@ create:
'(' key_list ')' key_options
{
LEX *lex=Lex;
- if ($2 != Key::FULLTEXT && lex->key_create_info.parser_name.str)
+ if ($3 != Key::FULLTEXT && lex->key_create_info.parser_name.str)
{
my_parse_error(ER(ER_SYNTAX_ERROR));
MYSQL_YYABORT;
}
- lex->key_list.push_back(new Key($2, $4.str, &lex->key_create_info, 0,
+ lex->key_list.push_back(new Key($3, $5.str, &lex->key_create_info, 0,
lex->col_list));
lex->col_list.empty();
}
@@ -5152,7 +5155,7 @@ string_list:
*/
alter:
- ALTER opt_ignore TABLE_SYM table_ident
+ ALTER build_method opt_ignore TABLE_SYM table_ident
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
@@ -5160,7 +5163,7 @@ alter:
lex->name.length= 0;
lex->sql_command= SQLCOM_ALTER_TABLE;
lex->duplicates= DUP_ERROR;
- if (!lex->select_lex.add_table_to_list(thd, $4, NULL,
+ if (!lex->select_lex.add_table_to_list(thd, $5, NULL,
TL_OPTION_UPDATING))
MYSQL_YYABORT;
lex->create_list.empty();
@@ -5177,9 +5180,10 @@ alter:
lex->alter_info.reset();
lex->alter_info.flags= 0;
lex->no_write_to_binlog= 0;
- lex->create_info.default_storage_media= HA_SM_DEFAULT;
+ lex->create_info.default_storage_media= HA_SM_DEFAULT;
+ lex->alter_info.build_method= $2;
}
- alter_commands build_method
+ alter_commands
{}
| ALTER DATABASE ident_or_empty
{
@@ -5436,23 +5440,15 @@ alter_commands:
build_method:
/* empty */
{
- Lex->alter_info.build_method= BUILD_METHOD_DEFAULT;
- }
- | ONLINE_SYM ONLY_SYM
- {
- Lex->alter_info.build_method= BUILD_METHOD_ONLINE;
+ $$= HA_BUILD_DEFAULT;
}
| ONLINE_SYM
{
- Lex->alter_info.build_method= BUILD_METHOD_ONLINE;
- }
- | OFFLINE_SYM ONLY_SYM
- {
- Lex->alter_info.build_method= BUILD_METHOD_OFFLINE;
+ $$= HA_BUILD_ONLINE;
}
| OFFLINE_SYM
{
- Lex->alter_info.build_method= BUILD_METHOD_OFFLINE;
+ $$= HA_BUILD_OFFLINE;
}
;
@@ -8240,14 +8236,15 @@ drop:
lex->drop_temporary= $2;
lex->drop_if_exists= $4;
}
- | DROP INDEX_SYM ident ON table_ident build_method {}
+ | DROP build_method INDEX_SYM ident ON table_ident {}
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_DROP_INDEX;
+ lex->alter_info.build_method= $2;
lex->alter_info.drop_list.empty();
lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
- $3.str));
- if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL,
+ $4.str));
+ if (!lex->current_select->add_table_to_list(lex->thd, $6, NULL,
TL_OPTION_UPDATING))
MYSQL_YYABORT;
}
@@ -10095,7 +10092,6 @@ keyword_sp:
| ONE_SHOT_SYM {}
| ONE_SYM {}
| ONLINE_SYM {}
- | ONLY_SYM {}
| PACK_KEYS_SYM {}
| PARTIAL {}
| PARTITIONING_SYM {}
--- 1.4/mysql-test/r/ndb_alter_table_online.result 2007-08-09 00:14:10 +02:00
+++ 1.5/mysql-test/r/ndb_alter_table_online.result 2007-08-09 00:14:10 +02:00
@@ -60,8 +60,8 @@ INSERT INTO t1 values (1,1);
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like
'%UserTable%');
truncate ndb_show_tables;
-ALTER TABLE t1 ADD c CHAR(19) DEFAULT 17 ONLINE;
-ERROR 42000: This version of MySQL doesn't yet support 'ALTER TABLE t1 ADD c CHAR(19)
DEFAULT 17 ONLINE'
+ALTER ONLINE TABLE t1 ADD c CHAR(19) DEFAULT 17;
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c
CHAR(19) DEFAULT 17'
ALTER TABLE t1 ADD c CHAR(19) DEFAULT 17;
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like
'%UserTable%';
@@ -78,8 +78,8 @@ INSERT INTO t1 values (1,1);
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like
'%UserTable%');
truncate ndb_show_tables;
-ALTER TABLE t1 ADD c CHAR(19) NOT NULL ONLINE;
-ERROR 42000: This version of MySQL doesn't yet support 'ALTER TABLE t1 ADD c CHAR(19) NOT
NULL ONLINE'
+ALTER ONLINE TABLE t1 ADD c CHAR(19) NOT NULL;
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c
CHAR(19) NOT NULL'
ALTER TABLE t1 ADD c CHAR(19) NOT NULL;
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like
'%UserTable%';
@@ -96,8 +96,8 @@ INSERT INTO t1 values (1,1);
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like
'%UserTable%');
truncate ndb_show_tables;
-ALTER TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED ONLINE;
-ERROR 42000: This version of MySQL doesn't yet support 'ALTER TABLE t1 ADD c CHAR(19)
COLUMN_FORMAT FIXED ONLINE'
+ALTER ONLINE TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
+ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c
CHAR(19) COLUMN_FORMAT FIXED'
ALTER TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like
'%UserTable%';
@@ -141,8 +141,8 @@ PRIMARY KEY (auto)
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
set @t1_id = (select id from ndb_show_tables where name like '%t1%' and type like
'%UserTable%');
truncate ndb_show_tables;
-alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL ONLINE;
-ERROR 42000: This version of MySQL doesn't yet support 'alter table t1 change tiny
new_tiny tinyint(4) DEFAULT '0' NOT NULL ONLINE'
+alter online table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
+ERROR 42000: This version of MySQL doesn't yet support 'alter online table t1 change tiny
new_tiny tinyint(4) DEFAULT '0' NOT NULL'
alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
select name from ndb_show_tables where id = @t1_id and name like '%t1%' and type like
'%UserTable%';
--- 1.2/mysql-test/t/ndb_alter_table_online.test 2007-08-09 00:14:10 +02:00
+++ 1.3/mysql-test/t/ndb_alter_table_online.test 2007-08-09 00:14:10 +02:00
@@ -102,7 +102,7 @@ set @t1_id = (select id from ndb_show_ta
truncate ndb_show_tables;
--error ER_NOT_SUPPORTED_YET
-ALTER TABLE t1 ADD c CHAR(19) DEFAULT 17 ONLINE;
+ALTER ONLINE TABLE t1 ADD c CHAR(19) DEFAULT 17;
ALTER TABLE t1 ADD c CHAR(19) DEFAULT 17;
--disable_warnings
@@ -130,7 +130,7 @@ set @t1_id = (select id from ndb_show_ta
truncate ndb_show_tables;
--error ER_NOT_SUPPORTED_YET
-ALTER TABLE t1 ADD c CHAR(19) NOT NULL ONLINE;
+ALTER ONLINE TABLE t1 ADD c CHAR(19) NOT NULL;
ALTER TABLE t1 ADD c CHAR(19) NOT NULL;
--disable_warnings
@@ -158,7 +158,7 @@ set @t1_id = (select id from ndb_show_ta
truncate ndb_show_tables;
--error ER_NOT_SUPPORTED_YET
-ALTER TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED ONLINE;
+ALTER ONLINE TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
ALTER TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
--disable_warnings
@@ -215,7 +215,7 @@ set @t1_id = (select id from ndb_show_ta
truncate ndb_show_tables;
--error ER_NOT_SUPPORTED_YET
-alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL ONLINE;
+alter online table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
--disable_warnings
--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
| Thread |
|---|
| • bk commit into 5.1 tree (mskold:1.2608) | Martin Skold | 9 Aug |