GROUP BY / HAVING fails to return results

Bug #1609557 reported by dweber
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sqlite3 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Ubuntu 12.04 is running on Travis.ci with sqlite 3.7.9 and that's where we ran into this bug (see https://github.com/travis-ci/travis-ci/issues/6406).

On sqlite3 3.6.20 (and likely the version on Travis, which is 3.7.9, but not on 3.7.17):

```
sqlite> SELECT * FROM ingests;
id ingest_id bag_id ingested created_at
---------- ------------------------------------ ---------- ---------- --------------------------
1 99bb3c9c-79b8-4fb4-bd16-91273a9485c4 1 f 2016-08-03 22:39:37.173484
2 06ac1f23-73a0-4185-9ce8-a3bb33079e68 1 t 2016-08-03 19:39:56.164517
3 308d53c9-a30d-403e-b7d9-182cdd22b33a 2 f 2016-08-03 18:40:20.198619
4 03f98430-c9b7-4500-aae8-4e3fcecdd56b 2 t 2016-08-02 20:40:38.293054
sqlite> SELECT * FROM ingests GROUP BY bag_id HAVING created_at = max(created_at);
sqlite> # wtf?
```

When using sqlite 3.13.0 it returns results, i.e.

```
sqlite> SELECT * FROM ingests GROUP BY bag_id HAVING created_at = max(created_at);
id ingest_id bag_id ingested created_at
---------- ------------------------------------ ---------- ---------- --------------------------
1 99bb3c9c-79b8-4fb4-bd16-91273a9485c4 1 f 2016-08-03 22:39:37.173484
3 308d53c9-a30d-403e-b7d9-182cdd22b33a 2 f 2016-08-03 18:40:20.198619
```

description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.