Description:
When I create a table with a primary key using ENGINE=NDB the table will not allow inserts. After doing some troubleshooting and build the same schema (create table command) using the myisam engine the insert queries work just fine.
Is there a known issue with primary key's and mysql clustering ?
Any help around this area would be greatly appreciated.
How to repeat:
Run these commands:
mysql> create table tri (i int) engine=ndbcluster;
Query OK, 0 rows affected (0.52 sec)
mysql> show create table tri;
+-------+--------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------+
| tri | CREATE TABLE `tri` (
`i` int(11) default NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 |
+-------+--------------------------------------------------------------------------------------------+
ALTER TABLE tri ADD PRIMARY KEY ( `i` );
Query OK, 0 rows affected (1.90 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> insert into tri (i) values (1);
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> ALTER TABLE tri DROP PRIMARY KEY;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: test
Query OK, 0 rows affected (1.95 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> insert into tri (i) values (1);
Query OK, 1 row affected (0.01 sec)
mysql> select * from tri;
+---+
| i |
+---+
| 1 |
+---+
1 row in set (0.01 sec)
mysql> show create table tri;
+-------+----------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------+
| tri | CREATE TABLE `tri` (
`i` int(11) NOT NULL default '0'
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 |
+-------+----------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)