The problem was apparently introduced by check-in [6e6b3729e0549de0]
FossilOrigin-Name: 30a4c323650cc9498a6dacd1760dd5170d7cc7848c4e96ff6bd64da365f96366
"missing database" as that meaning is now obsolete (since approx SQLite 2.0).
FossilOrigin-Name: 732f90d6327c5c6368fc8b4cc207bd644ef08e3ae6d2e7295258ab099deaba63
aggregate query in cases where the result of evaluating the term depends only
one one or more of the GROUP BY expressions (and on no other inputs).
FossilOrigin-Name: 5375a3ce56f1d993b13b469fe33ec7679948f53940f62a15ddbaeb8aaa26a22c