Database error messages
Database error messages in general are very bad. Why?
Oracle Version 8 had lots of messages such as "Invalid column name" where they meant:
- Column name not found in the table in question. The word "invalid" is the wrong word as it implies illegal characters or something like that.
- Which column? Which table? The parser surely knows this at the time it generates the error message. But it helpfully chooses not to inform the user.
Thankfully Oracle 10 has improved its error messages a lot. They include the statement in question and the point in the statement producing the problem. And error messages contain which foreign key constraint has been violated, and so on.
But I have the following problem with MySQL. I try to create a table with InnoDB with a foreign key constraint and it says:
ERROR 1005 (HY000): Can't create table './myschema/mytable.frm' (errno: 150)
What it means is: the statement has an error in it. But what is the error? In this case, there was a foreign key constraint and the column didn't exist in the referenced table. But why couldn't it tell me this?