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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
317efa2a
Commit
317efa2a
authored
Nov 08, 2013
by
Elena Stepanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Semantics of ALTER ONLINE changed to mirror ALTER .. LOCK=NONE
parent
cb888975
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
37 deletions
+104
-37
mysql-test/suite/storage_engine/alter_table_online.result
mysql-test/suite/storage_engine/alter_table_online.result
+10
-11
mysql-test/suite/storage_engine/alter_table_online.test
mysql-test/suite/storage_engine/alter_table_online.test
+22
-24
storage/innobase/mysql-test/storage_engine/disabled.def
storage/innobase/mysql-test/storage_engine/disabled.def
+0
-1
storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff
...myisam/mysql-test/storage_engine/alter_table_online.rdiff
+71
-0
storage/myisammrg/mysql-test/storage_engine/disabled.def
storage/myisammrg/mysql-test/storage_engine/disabled.def
+1
-1
No files found.
mysql-test/suite/storage_engine/alter_table_online.result
View file @
317efa2a
...
...
@@ -5,31 +5,30 @@ ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5;
ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>;
ALTER ONLINE TABLE t1 COMMENT 'new comment';
ALTER ONLINE TABLE t1 RENAME TO t2;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
DROP TABLE IF EXISTS t2;
Warnings:
Note 1051 Unknown table 'test.t2'
CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c');
ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5;
ERROR HY000: Can't execute the given 'ALTER' command as online
Warnings:
Warning 1366 Incorrect integer value: 'a' for column 'b' at row 1
Warning 1366 Incorrect integer value: 'b' for column 'b' at row 2
Warning 1366 Incorrect integer value: 'c' for column 'b' at row 3
ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>;
ERROR HY000: Can't execute the given 'ALTER' command as online
ALTER ONLINE TABLE t1 COMMENT 'new comment';
ERROR HY000: Can't execute the given 'ALTER' command as online
ALTER ONLINE TABLE t1 RENAME TO t2;
ERROR HY000: Can't execute the given 'ALTER' command as online
DROP TABLE t1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c');
ALTER ONLINE TABLE t1 DROP COLUMN b, ADD b <INT_COLUMN>;
ERROR HY000: Can't execute the given 'ALTER' command as online
ALTER ONLINE TABLE t1 MODIFY b BIGINT <CUSTOM_COL_OPTIONS>;
ERROR
HY000: Can't execute the given 'ALTER' command as online
ERROR
0A000: LOCK=NONE is not supported. Reason: Cannot change column type INPLACE. Try LOCK=SHARED.
ALTER ONLINE TABLE t1 ENGINE=MEMORY;
ERROR
HY000: Can't execute the given 'ALTER' command as online
ERROR
0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED.
DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
ALTER ONLINE TABLE t1 ADD INDEX (b);
ERROR HY000: Can't execute the given 'ALTER' command as online
ALTER TABLE t1 ADD INDEX (b);
ALTER ONLINE TABLE t1 DROP INDEX b;
ERROR HY000: Can't execute the given 'ALTER' command as online
DROP TABLE t1;
mysql-test/suite/storage_engine/alter_table_online.test
View file @
317efa2a
...
...
@@ -43,10 +43,15 @@ if ($mysql_errname)
--
source
unexpected_result
.
inc
}
# It is here because it used to be supported as ALTER ONLINE,
# but not anymore after the semantics changed in 10.0
# to be the same as ALTER .. LOCK=NONE
--
let
$error_codes
=
ER_ALTER_OPERATION_NOT_SUPPORTED
--
let
$online
=
1
--
let
$rename_to
=
t2
--
source
alter_table
.
inc
if
(
$mysql_errname
)
if
(
$mysql_errname
!=
ER_ALTER_OPERATION_NOT_SUPPORTED
)
{
--
source
unexpected_result
.
inc
DROP
TABLE
t1
;
...
...
@@ -54,7 +59,7 @@ if ($mysql_errname)
DROP
TABLE
IF
EXISTS
t2
;
#
# temporary table
s always require a copy
# temporary table
does not require locking
#
--
let
$temporary
=
1
...
...
@@ -62,32 +67,27 @@ DROP TABLE IF EXISTS t2;
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
1
,
'a'
),(
2
,
'b'
),(
3
,
'c'
);
--
let
$error_codes
=
ER_CANT_DO_ONLINE
--
let
$online
=
1
--
let
$alter_definition
=
MODIFY
b
$int_col
DEFAULT
5
--
source
alter_table
.
inc
if
(
$mysql_errname
!=
ER_CANT_DO_ONLINE
)
if
(
$mysql_errname
)
{
--
source
unexpected_result
.
inc
}
--
let
$error_codes
=
ER_CANT_DO_ONLINE
--
let
$online
=
1
--
let
$alter_definition
=
CHANGE
b
new_name
$int_col
--
source
alter_table
.
inc
--
let
$error_codes
=
ER_CANT_DO_ONLINE
--
let
$online
=
1
--
let
$alter_definition
=
COMMENT
'new comment'
--
source
alter_table
.
inc
--
let
$error_codes
=
ER_CANT_DO_ONLINE
--
let
$online
=
1
--
let
$rename_to
=
t2
--
source
alter_table
.
inc
DROP
TABLE
t1
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
#
# Test of things that is not possible to do online
...
...
@@ -98,23 +98,26 @@ DROP TABLE t1;
INSERT
INTO
t1
(
a
,
b
,
c
)
VALUES
(
1
,
100
,
'a'
),(
2
,
200
,
'b'
),(
3
,
300
,
'c'
);
--
let
$error_codes
=
ER_CANT_DO_ONLINE
# It is here because it used to unsupported as ALTER ONLINE,
# but is supported now after the semantics changed in 10.0
# to be the same as ALTER .. LOCK=NONE
--
let
$online
=
1
--
let
$alter_definition
=
DROP
COLUMN
b
,
ADD
b
$int_col
--
source
alter_table
.
inc
if
(
$mysql_errname
!=
ER_CANT_DO_ONLINE
)
if
(
$mysql_errname
)
{
--
source
unexpected_result
.
inc
}
--
let
$error_codes
=
ER_
CANT_DO_ONLINE
--
let
$error_codes
=
ER_
ALTER_OPERATION_NOT_SUPPORTED_REASON
--
let
$online
=
1
--
let
$alter_definition
=
MODIFY
b
BIGINT
$default_col_opts
--
source
alter_table
.
inc
--
let
$alternative_engine
=
`SELECT engine FROM information_schema.engines WHERE engine IN ('MEMORY','MyISAM') AND engine != '$storage_engine' ORDER BY engine LIMIT 1`
--
let
$error_codes
=
ER_
CANT_DO_ONLINE
--
let
$error_codes
=
ER_
ALTER_OPERATION_NOT_SUPPORTED_REASON
--
let
$online
=
1
--
let
$alter_definition
=
ENGINE
=
$alternative_engine
--
source
alter_table
.
inc
...
...
@@ -130,26 +133,21 @@ if ($mysql_errname)
}
if
(
!
$mysql_errname
)
{
--
let
$error_codes
=
ER_CANT_DO_ONLINE
--
let
$online
=
1
--
let
$alter_definition
=
ADD
INDEX
(
b
)
--
source
alter_table
.
inc
if
(
$mysql_errname
!=
ER_CANT_DO_ONLINE
)
{
--
let
$functionality
=
Adding
an
index
or
ALTER
ONLINE
--
source
unexpected_result
.
inc
}
# It is here because it used to unsupported as ALTER ONLINE,
# but is supported now after the semantics changed in 10.0
# to be the same as ALTER .. LOCK=NONE
--
let
$online
=
1
--
let
$alter_definition
=
ADD
INDEX
(
b
)
--
source
alter_table
.
inc
if
(
$mysql_errname
)
{
--
let
$functionality
=
Adding
an
index
or
ALTER
TABL
E
--
let
$functionality
=
Adding
an
index
or
ALTER
ONLIN
E
--
source
unexpected_result
.
inc
}
if
(
!
$mysql_errname
)
{
--
let
$error_codes
=
ER_CANT_DO_ONLINE
--
let
$online
=
1
--
let
$alter_definition
=
DROP
INDEX
b
--
source
alter_table
.
inc
...
...
storage/innobase/mysql-test/storage_engine/disabled.def
View file @
317efa2a
alter_table_online : MDEV-397 (Changing a column name via ALTER ONLINE does not work for InnoDB)
autoinc_vars : MySQL:65225 (InnoDB miscalculates auto-increment)
tbl_opt_ai : MySQL:65901 (AUTO_INCREMENT option on InnoDB table is ignored if added before autoinc column)
delete_low_prio : InnoDB does not use table-level locking
...
...
storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff
0 → 100644
View file @
317efa2a
--- suite/storage_engine/alter_table_online.result 2013-11-08 20:01:16.000000000 +0400
+++ suite/storage_engine/alter_table_online.reject 2013-11-08 20:02:03.000000000 +0400
@@ -2,8 +2,35 @@
CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c');
ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5;
+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed)
+# ------------ UNEXPECTED RESULT ------------
+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED.
+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>;
+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed)
+# ------------ UNEXPECTED RESULT ------------
+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED.
+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER ONLINE TABLE t1 COMMENT 'new comment';
+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed)
+# ------------ UNEXPECTED RESULT ------------
+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED.
+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER ONLINE TABLE t1 RENAME TO t2;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
DROP TABLE IF EXISTS t2;
@@ -23,12 +50,30 @@
CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c');
ALTER ONLINE TABLE t1 DROP COLUMN b, ADD b <INT_COLUMN>;
+ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed)
+# ------------ UNEXPECTED RESULT ------------
+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED.
+# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER ONLINE TABLE t1 MODIFY b BIGINT <CUSTOM_COL_OPTIONS>;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type INPLACE. Try LOCK=SHARED.
+ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected results: ER_ALTER_OPERATION_NOT_SUPPORTED_REASON)
ALTER ONLINE TABLE t1 ENGINE=MEMORY;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED.
DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
ALTER ONLINE TABLE t1 ADD INDEX (b);
-ALTER ONLINE TABLE t1 DROP INDEX b;
+ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed)
+# ------------ UNEXPECTED RESULT ------------
+# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED.
+# Adding an index or ALTER ONLINE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors.
+# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def.
+# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped.
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
DROP TABLE t1;
storage/myisammrg/mysql-test/storage_engine/disabled.def
View file @
317efa2a
alter_table_online : M
ySQL:57657
(Temporary MERGE table with temporary underlying is broken by ALTER)
alter_table_online : M
DEV-5266
(Temporary MERGE table with temporary underlying is broken by ALTER)
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