Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.1
-
None
Description
The option only forces a key (any key) on not nullable columns. As I understand from MDEV-5335, it was not the idea.
MariaDB [test]> set global innodb_force_primary_key = 1;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> create table t1 (i int not null);
|
ERROR 1173 (42000): This table type requires a primary key
|
MariaDB [test]> # works
|
|
MariaDB [test]> create table t1 (i int not null, key(i));
|
Query OK, 0 rows affected (0.61 sec)
|
|
MariaDB [test]> # but it's not a primary key or unique key
|
|
MariaDB [test]> insert into t1 values (1),(1);
|
Query OK, 2 rows affected (0.08 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> show create table t1 \G
|
*************************** 1. row ***************************
|
Table: t1
|
Create Table: CREATE TABLE `t1` (
|
`i` int(11) NOT NULL,
|
KEY `i` (`i`)
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
1 row in set (0.00 sec)
|
Attachments
Issue Links
- relates to
-
MDEV-5335 Force PK option
-
- Closed
-