Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
fd553062
Commit
fd553062
authored
Sep 25, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ALTER ONLINE to mean ALTER LOCK=NONE, not ALTER ALGORITHM=INPLACE.
Fix test results accordingly.
parent
dcc35b66
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
44 deletions
+28
-44
mysql-test/r/alter_table_online.result
mysql-test/r/alter_table_online.result
+14
-23
mysql-test/t/alter_table_online.test
mysql-test/t/alter_table_online.test
+12
-19
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-2
No files found.
mysql-test/r/alter_table_online.result
View file @
fd553062
...
...
@@ -2,41 +2,40 @@ drop table if exists t1,t2,t3;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 change b new_name int;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 modify e enum('a','b','c');
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 comment "new comment";
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 rename to t2;
alter online table t2 rename to t1;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 change b new_name int;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify e enum('a','b','c');
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 comment "new comment";
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 rename to t2;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
drop table t1;
drop table t2;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 drop column b, add b int;
ERROR 0A000:
ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
.
ERROR 0A000:
LOCK=NONE is not supported for this operation. Try LOCK=SHARED
.
alter online table t1 modify b bigint;
ERROR 0A000:
ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
.
ERROR 0A000:
LOCK=NONE is not supported for this operation. Try LOCK=SHARED
.
alter online table t1 modify e enum('c','a','b');
ERROR 0A000:
ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
.
ERROR 0A000:
LOCK=NONE is not supported for this operation. Try LOCK=SHARED
.
alter online table t1 modify c varchar(50);
ERROR 0A000:
ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
.
ERROR 0A000:
LOCK=NONE is not supported for this operation. Try LOCK=SHARED
.
alter online table t1 modify c varchar(100);
ERROR 0A000:
ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
.
ERROR 0A000:
LOCK=NONE is not supported for this operation. Try LOCK=SHARED
.
alter online table t1 add f int;
ERROR 0A000:
ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
.
ERROR 0A000:
LOCK=NONE is not supported for this operation. Try LOCK=SHARED
.
alter online table t1 engine=memory;
ERROR 0A000:
ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
.
ERROR 0A000:
LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
.
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
...
...
@@ -45,28 +44,20 @@ drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 drop column b, add b int;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify b bigint;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify e enum('c','a','b');
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify c varchar(50);
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify c varchar(100);
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 add f int;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 engine=memory;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 drop index b;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
drop table t1;
create table t1 (a int not null primary key, b int, c varchar(80));
create table t2 (a int not null primary key, b int, c varchar(80));
create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge UNION=(t1);
alter online table t3 union=(t1,t2);
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
drop table t1,t2,t3;
mysql-test/t/alter_table_online.test
View file @
fd553062
...
...
@@ -13,34 +13,32 @@ drop table if exists t1,t2,t3;
create
table
t1
(
a
int
not
null
primary
key
,
b
int
,
c
varchar
(
80
),
e
enum
(
'a'
,
'b'
));
insert
into
t1
(
a
)
values
(
1
),(
2
),(
3
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
modify
b
int
default
5
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
change
b
new_name
int
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
modify
e
enum
(
'a'
,
'b'
,
'c'
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
comment
"new comment"
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
rename
to
t2
;
alter
online
table
t2
rename
to
t1
;
drop
table
t1
;
#
#
temporary tables always require a copy
#
everything with temporary tables is "online", i.e. without locks
#
create
temporary
table
t1
(
a
int
not
null
primary
key
,
b
int
,
c
varchar
(
80
),
e
enum
(
'a'
,
'b'
));
insert
into
t1
(
a
)
values
(
1
),(
2
),(
3
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
modify
b
int
default
5
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
change
b
new_name
int
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
modify
e
enum
(
'a'
,
'b'
,
'c'
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
comment
"new comment"
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
rename
to
t2
;
drop
table
t
1
;
drop
table
t
2
;
#
# Test of things that is not possible to do online
...
...
@@ -61,7 +59,7 @@ alter online table t1 modify c varchar(50);
alter
online
table
t1
modify
c
varchar
(
100
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
add
f
int
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
_REASON
alter
online
table
t1
engine
=
memory
;
alter
table
t1
engine
=
innodb
;
...
...
@@ -73,26 +71,20 @@ drop table t1;
create
temporary
table
t1
(
a
int
not
null
primary
key
,
b
int
,
c
varchar
(
80
),
e
enum
(
'a'
,
'b'
));
insert
into
t1
(
a
)
values
(
1
),(
2
),(
3
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
#
# everything with temporary tables is "online", i.e. without locks
#
alter
online
table
t1
drop
column
b
,
add
b
int
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
modify
b
bigint
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
modify
e
enum
(
'c'
,
'a'
,
'b'
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
modify
c
varchar
(
50
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
modify
c
varchar
(
100
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
add
f
int
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
engine
=
memory
;
alter
table
t1
engine
=
innodb
;
alter
table
t1
add
index
(
b
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
add
index
c
(
c
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t1
drop
index
b
;
drop
table
t1
;
...
...
@@ -102,5 +94,6 @@ drop table t1;
create
table
t1
(
a
int
not
null
primary
key
,
b
int
,
c
varchar
(
80
));
create
table
t2
(
a
int
not
null
primary
key
,
b
int
,
c
varchar
(
80
));
create
table
t3
(
a
int
not
null
primary
key
,
b
int
,
c
varchar
(
80
))
engine
=
merge
UNION
=
(
t1
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
online
table
t3
union
=
(
t1
,
t2
);
drop
table
t1
,
t2
,
t3
;
sql/sql_yacc.yy
View file @
fd553062
...
...
@@ -7617,8 +7617,8 @@ alter_option:
IGNORE_SYM { Lex->ignore= 1;}
| ONLINE_SYM
{
Lex->alter_info.requested_
algorithm
=
Alter_info::ALTER_TABLE_
ALGORITHM_INPLAC
E;
Lex->alter_info.requested_
lock
=
Alter_info::ALTER_TABLE_
LOCK_NON
E;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment