To add:

The second query Seg-faults in the sqlite 3.8.8 dll near the end.
The other two runs to end.

It seems to be a NULL reference, the error ref:
   -- Last Script Error:   Exception Executing Script: Access violation 
at address 61C11C1E in module 'sqlite3.dll'. Read of address 00000000
   -- Query: Select * from RawDataSamples order by ChannelID, SeqIndex;

The last "seqIndex" value returned before the seg fault is 6360.

Not sure if it is relevant, but he has no Primary Key on that table, but 
uses the first column in two table constraints - both as a child link to 
a cascading foreign key in another table (which in turn links to many 
others) and in an non-Unique Index.

Schema:
CREATE TABLE "RawDataSamples" (
   "ChannelID" integer NOT NULL,
   "SeqIndex" integer NOT NULL,
   "Sample_0" double DEFAULT NULL,
   "Sample_1" double DEFAULT NULL,
... etc ...
   "Sample_29" double DEFAULT NULL,
   "Sample_30" double DEFAULT NULL,
FOREIGN KEY (ChannelID)
   REFERENCES "Channels"(ChanID)
   ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE INDEX RDChanID ON RawDataSamples (ChannelID);

Parent Schema:
CREATE TABLE "Channels" (
   "ChanID" INTEGER PRIMARY KEY,
   "SensorID" integer NOT NULL,
   "SequenceSetID" integer NOT NULL,
   "TGSetID" integer NOT NULL,
   "ChannelType" integer NOT NULL,
FOREIGN KEY (SensorID)
   REFERENCES "Sensors"(SensorID)
   ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (SequenceSetID)
   REFERENCES "SequenceDataSet"(SeqSetID)
   ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (TGSetID)
   REFERENCES "TimeGates"(TGSetID)
   ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (ChannelType)
   REFERENCES "ChannelTypes"(ChannelType)
   ON DELETE CASCADE ON UPDATE CASCADE
);



On 2015-04-11 09:05 PM, Stephen Lee wrote:
>
> Select count(*) from RawDataSamples order by ChannelID, SeqIndex will return
> 69770. (Correct value)
>
>   
>
> Select * from RawDataSamples order by ChannelID, SeqIndex will return 83665
> rows.
>
>   
>
> Select * from RawDataSamples order by SeqIndex,ChannelID will return 69770
> rows. (Again correct)

> The database file is at
> https://www.dropbox.com/s/1qo0qdeyn71biq4/land.sldb?dl=0
>
>

Reply via email to