Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.7.2, 11.8.5
-
None
-
None
Description
When innodb_force_primary_key = ON, creating a table with ENGINE=Aria without a PRIMARY KEY and then converting it to ENGINE=InnoDB does not enforce the presence of a PRIMARY KEY.
The ALTER TABLE ... ENGINE=InnoDB operation should fail in these cases, as it correctly does in versions 10.6 and 10.11.
This below in an example:
MariaDB [andre]> show variables like 'innodb_force_primary_key'; |
+--------------------------+-------+ |
| Variable_name | Value |
|
+--------------------------+-------+ |
| innodb_force_primary_key | ON | |
+--------------------------+-------+ |
1 row in set (0.002 sec) |
|
|
MariaDB [andre]> create table t1 (id int)engine=innodb; |
ERROR 1173 (42000): This table type requires a primary key |
|
|
MariaDB [andre]> create table t1 (id int)engine=aria; |
Query OK, 0 rows affected (0.015 sec) |
|
|
MariaDB [andre]> alter table t1 engine=innodb; |
Query OK, 0 rows affected (0.030 sec) |
Records: 0 Duplicates: 0 Warnings: 0
|
|
|
MariaDB [andre]> show create table t1\G |
*************************** 1. row ***************************
|
Table: t1 |
Create Table: CREATE TABLE `t1` ( |
`id` int(11) DEFAULT NULL |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci PAGE_CHECKSUM=1 |
1 row in set (0.003 sec) |