summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2010-03-04 12:29:22 +0100
committerMattias Jonsson <mattias.jonsson@sun.com>2010-03-04 12:29:22 +0100
commit48d986f5110c3eb3d0211c437ee87d965263c674 (patch)
tree1b49c655aae5fd5a6139935c87c87fdbe7c031dc /sql
parentee4a3099b3ebf0c9b448e4404665bb0a8638dc3f (diff)
downloadmariadb-git-48d986f5110c3eb3d0211c437ee87d965263c674.tar.gz
Bug#50104: Partitioned table with just 1 partion works with fk
There was no check for foreign keys when altering partitioned tables. Added check for FK when altering partitioned tables. mysql-test/r/partition_innodb.result: Bug#50104: Partitioned table with just 1 partion works with fk Updated test result mysql-test/t/partition_innodb.test: Bug#50104: Partitioned table with just 1 partion works with fk Added test for adding FK on partitioned tables (both 1 and 2 partitions) sql/sql_partition.cc: Bug#50104: Partitioned table with just 1 partion works with fk Disabled adding foreign key when altering a partitioned table.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_partition.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 275115e3cbd..f12194d7771 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -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