Merge pull request #1487 from IT-Can/query-error-sql-log

[Database] Extra debug info when there is a Query error.