[sqlite] Bug in sqlite? Can't read tables just after creating them

2014-03-11 Thread ftriboix
Hi,

I found a problem in sqlite.

In essence, here is what my code does:
 1 - It opens a database file
 2 - If it doesn't find certain tables, it assumes this is a new one and
creates the necessary tables and add a few entries in one of them (let's
call it mytable)
 3 - It queries mytable by doing a 'SELECT xyz, abc FROM mytable;'

When I run this code on Debian, I don't have any problem.

When I run it on my evaluation kit (ARM9), step 3 fails saying 'no such
table: mytable'. I found out that closing and then re-opening the database
file works. So I do steps 1 and 2, and close and re-open the database
file, and now step 3 works fine!

For the time being, I have this workaround of closing/re-opening the
database file, but that's really a kludge.

Any idea about from where this could come from?

Many thanks for any ideas!

  Fabrice


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


[sqlite] Question about how sqlite recovers after a power loss

2014-02-15 Thread ftriboix
Hello,

I would like to understand better at which moment does sqlite recovers
from a previous power loss.

Let's take the following scenario:
 - sqlite3_open()
 - BEGIN TRANSACTION;
 - INSERT INTO SomeTable VALUES ("blah", "blah", blah");
 => Power loss!
 - sqlite3_open()

What I notice, is that the 2nd sqlite3_open() succeeds, but the journal
file is left intact and not deleted.

I would like to know at what moment is the journal file actually deleted
after a power loss.

Many thanks!

  Fabrice


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