MySQL table structure:
CREATE TABLE `admin_folders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parent_id` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `ix_admin_folders_parent_id` (`parent_id`),
KEY `ix_admin_folders_name` (`name`),
KEY `ix_admin_folders_user_id` (`user_id`),
CONSTRAINT `admin_folders_parent_id_id` FOREIGN KEY (`parent_id`) REFERENCES `admin_folders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8
When I have the following entries in this table:
Due to the ON DELETE CASCADE constraint I expected that the rows with id 14 and 15 are getting deleted when I delete the one with id 13 since they're referenced.
But it's not deleting the referenced rows.
Where is my fault in that thought process?
Server version: 5.6.33-0ubuntu0.14.04.1-log - (Ubuntu)
UPDATE It is working, it seems to be a bug in PhpMyAdmin to not properly reload the result set.