Description:
Truncating an ndb table while data is being imported into it by redirecting a mysqldump file into the mysql client, results in the import failing with 'table doesn't exist' and an undeletable/unuseable table. I suspect it's more to do with the 'truncate-while-inserting' than the method though.
How to repeat:
In shell #1 inject a table dump of several million rows (enough to take several minutes) into the mysql client:
mysql db < tbl.sql
In shell #2, while the import in shell #1 is still running, log into the same sql node and issue the command:
truncate table tbl
more info:
using disk storage with 50gb tablespace file
table schema:
CREATE TABLE `tbl` (
`id` int(11) NOT NULL auto_increment,
`userid` int(11) NOT NULL default '0',
`expires` int(11) NOT NULL default '0',
`sessionid` varchar(40) NOT NULL default '',
`campaigncode` varchar(10) NOT NULL default '',
`countrycode` char(3) NOT NULL default '0',
`error` varchar(256) NOT NULL,
PRIMARY KEY (`id`),
KEY `userid` (`userid`),
KEY `sessionid` (`sessionid`)
) ENGINE=ndb tablespace ts_1 storage disk DEFAULT CHARSET=latin1;
Suggested fix:
I haven't yet found a fix or workaround