Spill out query and database detail at the time of bug report, to help r...

...eproduction of bugs.