When executing a multi-command script (for instance, a few CREATE TABLE commands and perhaps a few INSERT commands), particularly with the MySQL PDO driver for PHP, the return is always 0 (without any error info) even if the script contains errors - syntax or logic.
This prevents you from running a long build script and then checking to see if the script was executed successfully or not. If an error occurs, the process terminates at the point where the script fails, but still exists with 0 and no error information.
I have searched this site and the net for an answer to this question, and it seems that the general response is "there's nothing you can do about it". My current solution is to run a "verify build" query that checks for some data and assesses the response to that - this seems terribly inefficient.
Has anyone come across this problem? If so, how have you ensured the build script was executed successfully?