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:
@ -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));
|
||||
|
Reference in New Issue
Block a user