Inlcude SQL query in the log on SQL error (#1489064)