You don't show where you inserted your data.

Are you postiive ColC is an integer and you didn't insert it as a string?



You don't show a dump of your table which would be handy.



What does "bomb" mean?  Your program gets a seg fault or such?



What are you programming in, on what OS?



I can tell you now if there isn't a simple answer you need to make a complete 
example so somebody else can reproduce the problem and see what you're doing 
wrong (in all likelihood it's probably you).





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems

________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Dennis Volodomanov [i...@psunrise.com]
Sent: Thursday, June 21, 2012 8:15 AM
To: General Discussion of SQLite Database
Subject: EXT :[sqlite] An interesting (strange) issue with selects

Hello all,

I've been using SQLite for quite a few years, but have just recently
started exploring WAL mode (may or may not be related to WAL) and I'm
experiencing an interesting issue that perhaps is known to others, so
I've decided to ask for your wisdom. This is the amalgamation 3.7.13.

Let's consider the following setup - pragmas used (there's also a bunch
of indexes, but I believe those shouldn't affect the problem):

"PRAGMA journal_mode = WAL;";
"PRAGMA synchronous = NORMAL;";
"PRAGMA page_size = 4096;";
"PRAGMA read_uncommitted = 1;";

Also, some defines when building:

#define SQLITE_OMIT_DEPRECATED
#define SQLITE_DEFAULT_WAL_AUTOCHECKPOINT 5000
#define SQLITE_THREADSAFE 2
#define SQLITE_ENABLE_STAT3

Table:

"CREATE TABLE TableA (ColA INTEGER, ColB INTEGER, ColC INTEGER)";

Now the problem - the first SQL returns SQLITE_ROW and 1 as
sqlite3_column_int(), while the second doesn't find any items:

SELECT COUNT(ColA) FROM TableA;

SELECT ColA FROM CriteriaItemsToProcess WHERE ColC=0 LIMIT 1;

The data in the table is like this (that's the only one row):

1| 12| 0

Just as a side note, the same SQL/functions above work 99.9% of the
time, but bomb out once in a while. Most likely this doesn't help, but
thought I'd mention it.

I appreciate you reading so far and hopefully you can help me out.

Best regards,

    Dennis

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to