1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

cleanup: remove HA_WANTS_PRIMARY_KEY as redundant

We don't have many bits left, no need to add another InnoDB-specific flag.
Instead, we say that HA_REQUIRE_PRIMARY_KEY does not apply to SEQUENCE.
Meaning, if the engine declares HA_CAN_TABLES_WITHOUT_ROLLBACK (required
for SEQUENCE) it *must* support tables without a primary key.
This commit is contained in:
Sergei Golubchik
2018-11-16 18:23:15 +01:00
parent 5aaee3746e
commit 649465db41
4 changed files with 10 additions and 12 deletions

View File

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