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
975e14e4
Commit
975e14e4
authored
Jun 13, 2006
by
mikael@c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#20397: Crash at ALTER TABLE t1 engine = x; for partitioned table
parent
d2b04770
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
mysql-test/r/partition_error.result
mysql-test/r/partition_error.result
+24
-0
mysql-test/t/partition_error.test
mysql-test/t/partition_error.test
+20
-0
sql/sql_table.cc
sql/sql_table.cc
+12
-0
No files found.
mysql-test/r/partition_error.result
View file @
975e14e4
drop table if exists t1;
create table t1 (a int)
engine = x
partition by key (a);
Warnings:
Error 1286 Unknown table engine 'x'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a)
drop table t1;
create table t1 (a int)
engine = innodb
partition by list (a)
(partition p0 values in (0));
alter table t1 engine = x;
Warnings:
Error 1286 Unknown table engine 'x'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0) ENGINE = InnoDB)
drop table t1;
partition by list (a)
partitions 3
(partition x1 values in (1,2,9,4) tablespace ts1,
...
...
mysql-test/t/partition_error.test
View file @
975e14e4
...
...
@@ -8,6 +8,24 @@
drop
table
if
exists
t1
;
--
enable_warnings
#
# Bug 20397: Partitions: Crash when using non-existing engine
#
create
table
t1
(
a
int
)
engine
=
x
partition
by
key
(
a
);
show
create
table
t1
;
drop
table
t1
;
create
table
t1
(
a
int
)
engine
=
innodb
partition
by
list
(
a
)
(
partition
p0
values
in
(
0
));
alter
table
t1
engine
=
x
;
show
create
table
t1
;
drop
table
t1
;
#
# Partition by key stand-alone error
#
...
...
@@ -775,3 +793,5 @@ partition by range (a + (select count(*) from t1))
--
error
ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
create
table
t1
(
a
char
(
10
))
partition
by
hash
(
extractvalue
(
a
,
'a'
));
sql/sql_table.cc
View file @
975e14e4
...
...
@@ -4992,7 +4992,19 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
old_db_type
=
table
->
s
->
db_type
;
if
(
!
create_info
->
db_type
)
{
if
(
create_info
->
used_fields
&
HA_CREATE_USED_ENGINE
)
{
/*
This case happens when the user specified
ENGINE = x where x is a non-existing storage engine
We clear the flag and treat it the same way
as if no storage engine was specified.
*/
create_info
->
used_fields
^=
HA_CREATE_USED_ENGINE
;
}
create_info
->
db_type
=
old_db_type
;
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
if
(
prep_alter_part_table
(
thd
,
table
,
alter_info
,
create_info
,
old_db_type
,
...
...
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