Introduce optional logging of SQL statements.
Turned off by default, this will nonetheless help us troubleshoot issues related to the database as we will be able to ask people to turn SQL tracing on (`[trac] debug_sql = yes`).
Authored by: cboos 2009-05-21
Parent: [r8212]
Child: [r8214]