Hi all.
I have a problem. Unfortunately I have not been able to create a short
example to replicate my problem and the code itself is very long and
complicated.

Background:

   - My code is not multithreaded.
   - However, I am opening the same file more than once.

I am writing unit tests for my database functions.
In one test I'm opening the database.
Then I open the database again with a new pointer.
With that pointer I create the table with

"CREATE TABLE IF NOT EXISTS foo \
      ( id INTEGER PRIMARY KEY, \
      bar_id INTEGER, \
      hoopy INTEGER, \
      frood_id INTEGER )"

then I close that connection (with sqlite3_close) and with the old pointer I
do an sqlite3_prepare_v2 with

"SELECT frood_id,hoopy FROM ingredients WHERE bar_id=1"

This is where I get an SQLITE_SCHEMA error (from prepare) with the error
message: table 'foo' does not exist.

The scary part is that if I inject a new prepare/step sequence where I get
all tables from sqlite_master (in which 'foo' is listed), then suddenly the
select call works!

I think there is some SQLITE processing here that is either not committed
properly to the database or not finished before the sqlite3_exec call
returns. Anyone with any similar experiences?

Thank ye all kindly for any help!
/Daniel
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to