How an empty table can throw a "A foreign key constraint fails"? I have two table: "listini" and "listinoprezzi", the second one has a foreign reference to the first one. However the "listinoprezzi" is empty, and when I try to truncate "listini" I get:
#1701 - Cannot truncate a table referenced in a foreign key constraint (`listiniprezzi`, CONSTRAINT `listiniprezzi_ibfk_4` FOREIGN KEY (`listino`) REFERENCES `listini` (`id`))
How is it possible?