Merge "Tweaked location of profiling in query() to split out the implicit BEGIN"