Add documentation on how and when to use sqlite3_expanded_sql(P) to compute
the expanded text for legacy sqlite3_trace() compatibility.
FossilOrigin-Name: 163e15229d837a5471007cffb8d41faafd081737
testcase() macros that have side-effects, and reports errors when they are
found. Also fix a bug that this utility detected as it was being tested.
FossilOrigin-Name: b0b4624fc5d53bb0cc9fae7dad51984837d946ac