Bug 7184 raise mySQL error if debug is set
authorPaul Poulain <paul.poulain@biblibre.com>
Sun, 6 Nov 2011 08:36:52 +0000 (09:36 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Sun, 6 Nov 2011 14:41:28 +0000 (15:41 +0100)
commit016e66c6f25fbe3b648bcb8dad8d59f80d11b992
treeabf85af7a9d1989ac0404005a195b7da4c715de6
parent1e5347fb34d6adf94ee7db0375145e28267f4bc9
Bug 7184 raise mySQL error if debug is set

Before this patch, if a mySQL occured in Koha (any error), then the user was seeing nothing.
With this patch, if DEBUG is set in Koha VirtualHost, any mySQL error will make Koha die and display the SQL error

Step to test:
=== BEFORE PATCH ===
go anywhere, and change a mySQL statement to make it invalid.
Launch a page using the SQL you've made wrong, you'll see nothing, except you won't see the expected results

=== AFTER PATCH ===
Modify koha-httpd.conf, and add the following line, in the virtualhost (if it does not already exist)
SetEnv DEBUG 1
restart/reload Apache
Launch the same page, you'll get a Perl statement saying something like:

DBD::mysql::st execute failed: <<blablabla SQL error>> at <<where the error was raised line <<error line>>
C4/Context.pm