summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2015-08-08 12:49:20 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2015-08-08 19:32:40 +0300
commit46ad86f6a35aff59ecb68a23dba228e5796e935a (patch)
tree464ee50698a56547ba2152fcd2930c0827069ecd /storage
parent3307eaab68bf4818116a4fdd10b1a4f3427ea2ae (diff)
downloadmariadb-git-46ad86f6a35aff59ecb68a23dba228e5796e935a.tar.gz
MDEV-8582: innodb_force_primary_key option does not force PK or unique key
Analysis: Handler used table flag HA_REQUIRE_PRIMARY_KEY but a bug on sql_table.cc function mysql_prepare_create_table internally marked secondary key with NOT NULL colums as unique key and did not then fail on requirement that table should have primary key or unique key.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc5
-rw-r--r--storage/xtradb/handler/ha_innodb.cc5
2 files changed, 0 insertions, 10 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index fc8eb2a5b05..398b303897f 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -11134,11 +11134,6 @@ index_bad:
}
}
- if (srv_force_primary_key && form->s->primary_key >= MAX_KEY) {
- my_error(ER_REQUIRES_PRIMARY_KEY, MYF(0));
- DBUG_RETURN(false);
- }
-
row_format = form->s->row_type;
if (create_info->key_block_size) {
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index e38a3954069..6ee8d397368 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -11645,11 +11645,6 @@ index_bad:
}
}
- if (srv_force_primary_key && form->s->primary_key >= MAX_KEY) {
- my_error(ER_REQUIRES_PRIMARY_KEY, MYF(0));
- DBUG_RETURN(false);
- }
-
row_format = form->s->row_type;
if (create_info->key_block_size) {