Commit Graph

9 Commits

Author SHA1 Message Date
drh
ec27077c4f New test cases added.
FossilOrigin-Name: bdd1499c0fa4f8aadf4857a0ccc0d839c250369f29766ebef80330964905e63b
2022-04-11 18:54:23 +00:00
dan
d59f983501 Avoid a malfunction that could occur if the same correlated column reference appears in both the GROUP BY and the HAVING clause of a sub-select. dbsqlfuzz a779227f721a834df95f4f42d0c31550a1f8b8a2.
FossilOrigin-Name: 1e35cc6d5c2f563c6bb163bb150d7bc6ede4c993efa828af1face3261bf65a2c
2021-07-20 14:57:49 +00:00
dan
ed41a96bc1 Ensure that aggregate functions that (a) are part of SELECT statements with no FROM clause and (b) have one or more scalar sub-selects as arguments are assigned to the correct aggregate context.
FossilOrigin-Name: 16a41fa8c4c74bba4e908a9c19e6cf5a927cac140e2070c9abf303158be7257b
2020-06-09 17:45:48 +00:00
drh
80f6bfc064 Improvements to the algorithm that determines which SELECT in a sequence
of nested SELECT statements that an aggregate function belongs to.  This
resolves an issue identified by dbsqlfuzz.

FossilOrigin-Name: d768007473f4ed40abbdf2c7e501b580b1cc37c1620c7cb90af1f208a8c35145
2019-08-31 20:13:30 +00:00
dan
280c894b74 Calculate non-aggregate expressions in the SELECT list of an aggregate query
that does not use min() or max() once per group, instead of once per row
visited.

FossilOrigin-Name: dce2dfbe1590deb3ef5661230ae2d232bd492441195defbf698ac56f9629211c
2018-06-05 20:04:28 +00:00
drh
9588ad95c1 Do not flatten aggregate subqueries that contain min() or max() functions
so that if the min()/max() are discarded by the outer query, they still
function and cause non-aggregate expression to be evaluated on the minimal
or maximal row.

FossilOrigin-Name: 0bdf1a086b3946722f4d4b328e25917f61c14713
2014-09-15 14:46:02 +00:00
drh
e0b2d5dabb Adding test cases for ticket [bfbf38e5e9956a]
FossilOrigin-Name: 62ebfa747635a5593759ea2a28166d054c8eee8a
2012-11-02 19:08:31 +00:00
drh
ed551b95a4 Add test cases and fix bugs associated with the previous check-in
enhancements to nested aggregate subquery processing.

FossilOrigin-Name: 00b1dc71be4c3420730b5f7840af824ea86165e7
2012-08-23 19:46:11 +00:00
drh
030796df8d Further improvements to the processing of nested aggregate queries.
FossilOrigin-Name: 3c3ffa901f5ce8a523028ff15563ce3e0f55a641
2012-08-23 16:18:10 +00:00