When creating tables with referential integrity in MySQL you still get gems like, e.g.:
mysql> create table jimtest ( colA varchar(32) NOT NULL, CONSTRAINT fk1 FOREIGN KEY(colA) REFERENCES jimtest2(colA) ON DELETE CASCADE ); ERROR 1005 (HY000): Can't create table './test/jimtest.frm' (errno: 150) Same indecipherable error for non-existent referenced table, or column type mismatch, or a missing index. Admittedly, you learn what to look for after a while, but the error message sucks. On Wed, Jan 21, 2009 at 11:06 PM, Christopher Schultz < ch...@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Rusty, > > Rusty Wright wrote: > > I think the biggest gripe I've had with mysql is the problem where I was > > violating a unique constraint and it was giving me some generic > > (completely useless) error; HY001 I think. > > I've always found the error messages themselves very informative. For > instance, if I attempt to insert a record into a table with an FK that > doesn't match, MySQL's command-line interface gives me this message: > > ERROR 1452 (23000): Cannot add or update a child row: a foreign key > constraint fails (`database/target_table`, CONSTRAINT > `name_of_foreign_key_constraint` FOREIGN KEY (`column_name`) REFERENCES > `source_table` (`column_name`)) > > Perhaps Connector/J doesn't give quite such useful error messages, but I > seem to recall something nice like "Foreign key constraint check failed". > > I have found that every database has stupid error codes and you > basically have to code your app around tables of db-specific error codes > if you want to give your users (or log files) anything better than the > driver-supplied error messages. > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkl38NUACgkQ9CaO5/Lv0PCwAgCggKgAfu/ZZ+ClRAGtEuM4+xyK > e7EAn0R/4fyPgBfhxSB51um5ZW63jZzL > =xo6L > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >