Improved MySQL error reporting