I have a table without any primary key and want to insert rows to in
using the NDB API.
On NDB level there is primary key always.
If not specified on MySQL level, it is added as last attribute $PK.
% mysql test
create table t1 (a int);
^D
% ndb_desc -d test t1
...
-- Attributes --
a Int NULL
$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY
(should be renamed to ndb$pk ...)
message "Operation was not defined correctly, probably missing a key"
You have to do equal() on $PK.
with error code 4116. In 4.1.19 there is a method setTupleId in
NdbOperation to set a uniq tuple id for rows without a primary key.
You're right. These methods are unsupported so they change without notice.
In >= 5.0 use getAutoIncrementValue() to get next value
(from cache or sequence stored in SYSTAB_0) and then do equal() on it.