This statement “hangs” the server:
DELETE FROM StockPositions WHERE machineName LIKE 'P%';
and
DELETE FROM StockPositions WHERE machineName LIKE 'P%' LIMIT 1;
EDIT: This actually DOES work! I will continue to test when it fails. I’m leaning towards some kind of locking issue anyway…
The corresponding SELECT-statements work as expected (returning 500 rows).
This statement works fine:
DELETE FROM StockPositions WHERE ID = 5226;
- No foreign key cascade tables deletes. EDIT: Wrong! See my answer below.
- No triggers.
- No locks (appearantly).
- No ideas.
Any ideas what to look for?
(No panic – I can solve this by workarounds but I’d really want to know what’s going on!)
EDIT:
CREATE TABLE `StockPositions` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`isEnabled` tinyint(1) DEFAULT NULL,
`readableName` varchar(32) NOT NULL,
`machineName` varchar(32) NOT NULL,
`longName` varchar(64) DEFAULT NULL,
`accessibilityLevel` int(10) unsigned NOT NULL,
`storey` char(1) DEFAULT NULL,
`lengthX` decimal(10,3) unsigned DEFAULT NULL,
`lengthY` decimal(10,3) unsigned DEFAULT NULL,
`lengthZ` decimal(10,3) unsigned DEFAULT NULL,
`positionType` varchar(50) DEFAULT NULL,
`type` int(11) DEFAULT NULL,
`frequency` int(11) DEFAULT NULL,
`module` varchar(10) DEFAULT NULL,
`prioritized` tinyint(4) DEFAULT NULL,
`aisleID` int(10) DEFAULT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `readableName` (`readableName`),
UNIQUE KEY `machineName` (`machineName`)
) ENGINE=InnoDB AUTO_INCREMENT=11820 DEFAULT CHARSET=utf8
Sorry! * blushing *
The DELETE CASCADE is found in the child-table (not the parent).
Good to know. Thank you for you time and effort!