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
2cecb5a6
Commit
2cecb5a6
authored
Jul 04, 2023
by
Nikita Malyavin
Committed by
Sergei Golubchik
Aug 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-31601 Some ALTER TABLEs fail ... with a wrong error message
Report correct algorithm in the error message.
parent
8a165d7c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
2 deletions
+30
-2
mysql-test/main/alter_table_online.result
mysql-test/main/alter_table_online.result
+13
-0
mysql-test/main/alter_table_online.test
mysql-test/main/alter_table_online.test
+15
-0
mysql-test/main/mysql57_virtual.result
mysql-test/main/mysql57_virtual.result
+1
-1
sql/sql_table.cc
sql/sql_table.cc
+1
-1
No files found.
mysql-test/main/alter_table_online.result
View file @
2cecb5a6
...
...
@@ -206,3 +206,16 @@ drop table t;
create table t (a int, b int, c char(8), key(a,b,c));
alter table t modify c int auto_increment key, algorithm=copy;
drop table t;
# MDEV-31601 Some ALTER TABLE .. fail when they worked before, and with
# a wrong error message
create table t (a int) engine=aria;
insert into t values (1),(2);
alter table t algorithm=nocopy, order by a;
ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=COPY
alter table t engine=myisam, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
drop table t;
create temporary table t (f int);
alter table t force, algorithm=instant;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
drop table t;
mysql-test/main/alter_table_online.test
View file @
2cecb5a6
...
...
@@ -207,3 +207,18 @@ drop table t;
create
table
t
(
a
int
,
b
int
,
c
char
(
8
),
key
(
a
,
b
,
c
));
alter
table
t
modify
c
int
auto_increment
key
,
algorithm
=
copy
;
drop
table
t
;
--
echo
# MDEV-31601 Some ALTER TABLE .. fail when they worked before, and with
--
echo
# a wrong error message
create
table
t
(
a
int
)
engine
=
aria
;
insert
into
t
values
(
1
),(
2
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
table
t
algorithm
=
nocopy
,
order
by
a
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
table
t
engine
=
myisam
,
algorithm
=
inplace
;
drop
table
t
;
create
temporary
table
t
(
f
int
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED
alter
table
t
force
,
algorithm
=
instant
;
drop
table
t
;
mysql-test/main/mysql57_virtual.result
View file @
2cecb5a6
...
...
@@ -14,7 +14,7 @@ a b c
1 2 4
2 3 5
alter online table mysql57_virtual comment "I am now a MariaDB table", algorithm=nocopy;
ERROR 0A000: ALGORITHM=
INPLACE
is not supported for this operation. Try ALGORITHM=COPY
ERROR 0A000: ALGORITHM=
NOCOPY
is not supported for this operation. Try ALGORITHM=COPY
alter table mysql57_virtual comment "I am now a MariaDB table";
SHOW CREATE TABLE mysql57_virtual;
Table Create Table
...
...
sql/sql_table.cc
View file @
2cecb5a6
...
...
@@ -10690,7 +10690,7 @@ do_continue:;
if
(
alter_info
->
algorithm_is_nocopy
(
thd
))
{
my_error
(
ER_ALTER_OPERATION_NOT_SUPPORTED
,
MYF
(
0
),
"ALGORITHM=INPLACE"
,
"ALGORITHM=COPY"
);
alter_info
->
algorithm_clause
(
thd
)
,
"ALGORITHM=COPY"
);
DBUG_RETURN
(
true
);
}
...
...
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