nakijun / spatialite-android

Automatically exported from code.google.com/p/spatialite-android
0 stars 0 forks source link

Having clause doesn't work particularly well #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
On in a spatialite enabled database:

CREATE TABLE SampleValue (
  UUID                 integer NOT NULL,
  ValueTimestamp       DATETIME DEFAULT CURRENT_TIMESTAMP,
  VocabID              INTEGER,
  AttributeID          TEXT NOT NULL,
  FreeText             TEXT
);
INSERT INTO sampleValue(uuid, valuetimestamp, vocabid, attributeId, freetext) 
values(1, '2013-02-15 00:41:09', 1, 1, 'foo');
INSERT INTO sampleValue(uuid, valuetimestamp, vocabid, attributeId, freetext) 
values(1, '2012-02-15 00:41:09', 1, 1, 'bar');
INSERT INTO sampleValue(uuid, valuetimestamp, vocabid, attributeId, freetext) 
values(1, '2011-02-15 00:41:09', 1, 1, 'baz');
select * from sampleValue group by uuid, attributeID having max(valuetimestamp);

the select will return the wrong value.

What is the expected output? What do you see instead?

Expected output is: 
1|2013-02-15 00:41:09|1|1|foo

Output gotten is the 2011 result.

What version of the product are you using? On what operating system?
spatialite-android 3.0.1

Please provide any additional information below.

An android project replicating this (can also be replicated in pure sqlite with 
the right version) can be found at: http://dl.dropbox.com/u/60155570/bug.zip 
(linked without attachment due to size)

Original issue reported on code.google.com by Denub...@gmail.com on 18 Feb 2013 at 4:33

Attachments:

GoogleCodeExporter commented 9 years ago
Project has moved to Spatialite version 4.0. If this can be repeated with 
SQLITE I would report the issue to the SQLITE project.

Original comment by efroh...@gmail.com on 29 Apr 2013 at 1:25