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
459d04c6
Commit
459d04c6
authored
Mar 11, 2010
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
1a9ec920
48d986f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
2 deletions
+55
-2
mysql-test/r/partition_innodb.result
mysql-test/r/partition_innodb.result
+21
-1
mysql-test/t/partition_innodb.test
mysql-test/t/partition_innodb.test
+28
-1
sql/sql_partition.cc
sql/sql_partition.cc
+6
-0
No files found.
mysql-test/r/partition_innodb.result
View file @
459d04c6
drop table if exists t1;
drop table if exists t1, t2;
#
# Bug#50104: Partitioned table with just 1 partion works with fk
#
CREATE TABLE t2 (
id INT,
PRIMARY KEY (id)
) ENGINE=InnoDB ;
CREATE TABLE t1 (
id INT NOT NULL AUTO_INCREMENT,
parent_id INT DEFAULT NULL,
PRIMARY KEY (id),
KEY parent_id (parent_id)
) ENGINE=InnoDB;
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 1;
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 2;
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
DROP TABLE t1, t2;
create table t1 (a int not null,
b datetime not null,
primary key (a,b))
...
...
mysql-test/t/partition_innodb.test
View file @
459d04c6
...
...
@@ -2,11 +2,38 @@
--
source
include
/
have_innodb
.
inc
--
disable_warnings
drop
table
if
exists
t1
;
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
let
$MYSQLD_DATADIR
=
`SELECT @@datadir`
;
--
echo
#
--
echo
# Bug#50104: Partitioned table with just 1 partion works with fk
--
echo
#
CREATE
TABLE
t2
(
id
INT
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
;
CREATE
TABLE
t1
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
parent_id
INT
DEFAULT
NULL
,
PRIMARY
KEY
(
id
),
KEY
parent_id
(
parent_id
)
)
ENGINE
=
InnoDB
;
ALTER
TABLE
t1
PARTITION
BY
HASH
(
id
)
PARTITIONS
1
;
--
error
ER_FOREIGN_KEY_ON_PARTITIONED
ALTER
TABLE
t1
ADD
CONSTRAINT
test_ibfk_1
FOREIGN
KEY
(
parent_id
)
REFERENCES
t2
(
id
);
ALTER
TABLE
t1
PARTITION
BY
HASH
(
id
)
PARTITIONS
2
;
--
error
ER_FOREIGN_KEY_ON_PARTITIONED
ALTER
TABLE
t1
ADD
CONSTRAINT
test_ibfk_1
FOREIGN
KEY
(
parent_id
)
REFERENCES
t2
(
id
);
DROP
TABLE
t1
,
t2
;
#
# Bug#47029: Crash when reorganize partition with subpartition
#
...
...
sql/sql_partition.cc
View file @
459d04c6
...
...
@@ -4273,6 +4273,12 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
{
DBUG_ENTER
(
"prep_alter_part_table"
);
/* Foreign keys on partitioned tables are not supported, waits for WL#148 */
if
(
table
->
part_info
&&
(
alter_info
->
flags
&
ALTER_FOREIGN_KEY
))
{
my_error
(
ER_FOREIGN_KEY_ON_PARTITIONED
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
/*
We are going to manipulate the partition info on the table object
so we need to ensure that the data structure of the table object
...
...
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