Hello Simon, Below is the query, and the schema I’m trying to debug. FYI: I’m signed up for the daily digest, so please CC kla...@hach.com<mailto:kla...@hach.com> on replies for a faster response.
CREATE TABLE userParameter ( hepi_parameter_id INT NOT NULL ,hepi_category INT NOT NULL ,hepi_number INT NOT NULL ,preferredUnit INT ,rtTableSort INT ,rtGraphSort INT ,rtGridSort INT ,dpTableSort INT ,dpGraphSort INT ,dpGridSort INT ,name_deviceString_id INT ,abbr_deviceString_id INT ,units_deviceString_id INT ,nameString TEXT COLLATE BINARY ,abbrString TEXT COLLATE BINARY ,unitsString TEXT ); CREATE INDEX idxHepi_parameter_id ON userParameter (hepi_parameter_id); CREATE INDEX idxRtTableSort ON userParameter (rtTableSort); CREATE INDEX idxDpTableSort ON userParameter (dpTableSort); CREATE INDEX idxNameString ON userParameter (nameString COLLATE BINARY); CREATE INDEX idxAbbrString ON userParameter (abbrString COLLATE BINARY); INSERT INTO "userParameter" VALUES(32785,1,1,1,0,1000,1000,1000,1000,1000,2,24,127,'Temperature','Temp','°C'); INSERT INTO "userParameter" VALUES(32786,1,2,1,1000,1000,1000,1000,1000,1000,2,24,128,'Temperature','Temp','°F'); INSERT INTO "userParameter" VALUES(32787,1,3,1,1000,1000,1000,1000,1000,1000,2,24,129,'Temperature','Temp','°K'); INSERT INTO "userParameter" VALUES(32817,3,1,1,1000,1000,1000,1000,1000,1000,138,125,139,'Resistivity','Res','kΩ-cm'); INSERT INTO "userParameter" VALUES(32833,4,1,1,1000,1000,1000,1000,1000,1000,140,141,137,'Specific Conductivity','SpCond','mS/cm'); INSERT INTO "userParameter" VALUES(32834,4,2,1,1000,1000,1000,1000,1000,1000,140,141,142,'Specific Conductivity','SpCond','µS/cm'); INSERT INTO "userParameter" VALUES(32849,5,1,1,1000,1000,1000,1000,1000,1000,143,144,145,'Salinity','Sal','psu'); INSERT INTO "userParameter" VALUES(32850,5,2,1,1000,1000,1000,1000,1000,1000,143,144,146,'Salinity','Sal','ppt'); INSERT INTO "userParameter" VALUES(32865,6,1,1,1000,1000,1000,1000,1000,1000,147,148,149,'Total Dissolved Solids','TDS','g/L'); INSERT INTO "userParameter" VALUES(32881,7,1,1,1000,1000,1000,1000,1000,1000,203,203,204,'DO','DO','%SAT'); INSERT INTO "userParameter" VALUES(32897,8,1,1,1000,1000,1000,1000,1000,1000,203,203,196,'DO','DO','mg/L'); INSERT INTO "userParameter" VALUES(32929,10,1,1,1000,1000,1000,1000,1000,1000,6,6,213,'pH','pH','units'); INSERT INTO "userParameter" VALUES(32945,11,1,1,1000,1000,1000,1000,1000,1000,6,6,214,'pH','pH','mV'); INSERT INTO "userParameter" VALUES(33249,30,1,1,1000,1000,1000,1000,1000,1000,223,224,214,'Reference','Ref','mV'); INSERT INTO "userParameter" VALUES(32961,12,1,1,1000,1000,1000,1000,1000,1000,7,7,214,'ORP','ORP','mV'); INSERT INTO "userParameter" VALUES(32977,13,1,1,1000,1000,1000,1000,1000,1000,8,8,240,'Depth','Depth','meters'); INSERT INTO "userParameter" VALUES(32978,13,2,1,1000,1000,1000,1000,1000,1000,8,8,241,'Depth','Depth','feet'); INSERT INTO "userParameter" VALUES(33377,38,1,1,1000,1000,1000,1000,1000,1000,794,794,242,'Pressure','Pressure','psig'); INSERT INTO "userParameter" VALUES(33378,38,2,1,1000,1000,1000,1000,1000,1000,794,794,250,'Pressure','Pressure','psia'); INSERT INTO "userParameter" VALUES(32993,14,1,1,1000,1000,1000,1000,1000,1000,257,257,259,'TDG','TDG','mmHg'); INSERT INTO "userParameter" VALUES(32994,14,2,1,1000,1000,1000,1000,1000,1000,257,257,250,'TDG','TDG','psia'); INSERT INTO "userParameter" VALUES(33009,15,1,1,1000,1000,1000,1000,1000,1000,10,268,272,'Turbidity','Turb','NTU'); INSERT INTO "userParameter" VALUES(33010,15,2,1,1000,1000,1000,1000,1000,1000,10,268,273,'Turbidity','Turb','FNU'); INSERT INTO "userParameter" VALUES(33025,16,1,1,1000,1000,1000,1000,1000,1000,287,288,294,'Chlorophyll a','CHL','µg/L'); INSERT INTO "userParameter" VALUES(33041,17,1,1,1000,1000,1000,1000,1000,1000,287,288,245,'Chlorophyll a','CHL','V'); INSERT INTO "userParameter" VALUES(32913,9,1,1,1000,1000,1000,1000,1000,1000,14,299,259,'Barometric Pressure','BP','mmHg'); INSERT INTO "userParameter" VALUES(33057,18,1,1,1000,1000,1000,1000,1000,1000,331,332,334,'Rhodamine WT','RWT','ppb'); INSERT INTO "userParameter" VALUES(33073,19,1,1,1000,1000,1000,1000,1000,1000,331,332,245,'Rhodamine WT','RWT','V'); INSERT INTO "userParameter" VALUES(33089,20,1,1,1000,1000,1000,1000,1000,1000,343,344,345,'Phycocyanin','PCY','cells/mL'); INSERT INTO "userParameter" VALUES(33105,21,1,1,1000,1000,1000,1000,1000,1000,343,344,245,'Phycocyanin','PCY','V'); INSERT INTO "userParameter" VALUES(33121,22,1,1,1000,1000,1000,1000,1000,1000,352,353,345,'Phycoerythrin','PRY','cells/mL'); INSERT INTO "userParameter" VALUES(33137,23,1,1,1000,1000,1000,1000,1000,1000,352,353,245,'Phycoerythrin','PRY','V'); INSERT INTO "userParameter" VALUES(33265,31,1,1,1000,1000,1000,1000,1000,1000,543,373,245,'Battery Voltage','Batt','V'); INSERT INTO "userParameter" VALUES(33281,32,1,1,1000,1000,1000,1000,1000,1000,544,464,245,'Clock Battery Voltage','ClockBatt','V'); INSERT INTO "userParameter" VALUES(33297,33,1,1,1000,1000,1000,1000,1000,1000,399,399,400,'Density','Density','kg/m3'); INSERT INTO "userParameter" VALUES(33153,24,1,1,1000,1000,1000,1000,1000,1000,401,401,402,'NH4+','NH4+','mg/L-N'); INSERT INTO "userParameter" VALUES(33169,25,1,1,1000,1000,1000,1000,1000,1000,403,403,402,'NH4Tot','NH4Tot','mg/L-N'); INSERT INTO "userParameter" VALUES(33185,26,1,1,1000,1000,1000,1000,1000,1000,404,404,402,'NO3-','NO3-','mg/L-N'); INSERT INTO "userParameter" VALUES(33201,27,1,1,1000,1000,1000,1000,1000,1000,401,401,214,'NH4+','NH4+','mV'); INSERT INTO "userParameter" VALUES(33217,28,1,1,1000,1000,1000,1000,1000,1000,404,404,214,'NO3-','NO3-','mV'); INSERT INTO "userParameter" VALUES(33233,29,1,1,1000,1000,1000,1000,1000,1000,405,405,196,'Cl-','Cl-','mg/L'); INSERT INTO "userParameter" VALUES(33329,35,1,1,1000,1000,1000,1000,1000,1000,418,422,240,'Altitude','Alt','meters'); INSERT INTO "userParameter" VALUES(33345,36,1,1,1000,1000,1000,1000,1000,1000,419,420,423,'Latitude','Lat','degrees'); INSERT INTO "userParameter" VALUES(33266,31,2,1,1000,1000,1000,1000,1000,1000,548,373,556,'Battery Level','Batt','%'); INSERT INTO "userParameter" VALUES(33330,35,2,1,1000,1000,1000,1000,1000,1000,418,422,241,'Altitude','Alt','feet'); INSERT INTO "userParameter" VALUES(33361,37,1,1,1000,1000,1000,1000,1000,1000,720,721,423,'Longitude','Lon','degrees'); INSERT INTO "userParameter" VALUES(32914,9,2,1,1000,1000,1000,1000,1000,1000,14,299,723,'Barometric Pressure','BP','psi'); INSERT INTO "userParameter" VALUES(32915,9,3,1,1000,1000,1000,1000,1000,1000,14,299,724,'Barometric Pressure','BP','mbar'); select (rtTableSort < 1000) as selected, abbrString from userParameter order by abbrString; This used to work until we upgraded sqlite to v3.8.2. It still does work at the PC level. I’m wondering if we are short on RAM, and the sort engine is failing quietly, returning the un-sorted query with SQLITE_OK. Thank you, Ken ken labar | Embedded Firmware Engineer Hach Hydromet | www.hachhydromet.com<http://www.hachhydromet.com/> | kla...@hach.com<mailto:kla...@hach.com> Innovating technology behind better data Please be advised that this email may contain confidential information. If you are not the intended recipient, please notify us by email by replying to the sender and delete this message. The sender disclaims that the content of this email constitutes an offer to enter into, or the acceptance of, any agreement; provided that the foregoing does not invalidate the binding effect of any digital or other electronic reproduction of a manual signature that is included in any attachment. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users