1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1

Fixed by adding table flag HA_WANTS_PRIMARY_KEY, which is like
HA_REQUIRE_PRIMARY_KEY but tells SQL upper layer that the storage engine
internally can handle tables without primary keys (for example for
sequences or trough user variables)
This commit is contained in:
Monty
2018-10-29 16:12:52 +02:00
parent 6a6cc8a653
commit d30124e844
6 changed files with 31 additions and 2 deletions

View File

@ -4134,7 +4134,9 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
}
if (!unique_key && !primary_key &&
(file->ha_table_flags() & HA_REQUIRE_PRIMARY_KEY))
((file->ha_table_flags() & HA_REQUIRE_PRIMARY_KEY) ||
((file->ha_table_flags() & HA_WANTS_PRIMARY_KEY) &&
!create_info->sequence)))
{
my_message(ER_REQUIRES_PRIMARY_KEY, ER_THD(thd, ER_REQUIRES_PRIMARY_KEY),
MYF(0));