Re: [sqlite] problem with blobs (perl code)

2005-11-30 Thread Nathan Kurz
On Wed, Nov 30, 2005 at 05:10:19PM -0600, Jim Dodgen wrote: > > What do you get back (using the command-line client) when you > > ask for LENGTH(x) or QUOTE(x) instead of just the column x? > > sqlite> select length(val) from foo; > 3 > sqlite> select quote(val) from foo; > 'MZP' > > strange,

Re: [sqlite] problem with blobs (perl code) workaround

2005-11-30 Thread Jim Dodgen
thanks for the help, I tried one ot the workarounds noted in http://rt.cpan.org/NoAuth/Bug.html?id=14595 which had you force the data type to SQL_BLOB this makes things work!! horray!! I included the complete test program for reference to others code snippit use DBI

[sqlite] Feature request

2005-11-30 Thread Cariotoglou Mike
Hi all. I would like to propose an enchancement in sqlite. I am not sure whether the issue has come up before, if it has, and has been shot down, pls let me know. The concept of in-memory database would be greatly enhanced if there was a mechanism to serialize the internal cache to/from a

Re: [sqlite] problem with blobs (perl code)

2005-11-30 Thread drh
Nathan Kurz <[EMAIL PROTECTED]> wrote: > On Wed, Nov 30, 2005 at 04:36:30PM -0600, Jim Dodgen wrote: > > The Perl interface through DBD-SQLite-1.09 is broken with regard to > blobs. It binds the result as text, thus doesn't handle NUL's. > > I've submitted a patch

Re: [sqlite] sqlite3_progress_handler

2005-11-30 Thread drh
Marco Bambini <[EMAIL PROTECTED]> wrote: > From the documentation: "If the progress callback returns a result > other than 0, then the current query is immediately terminated...", > so next time I call sqlite3_step what is the error returned? > SQLITE_ERROR or SQLITE_ABORT or something else?

[sqlite] sqlite3_progress_handler

2005-11-30 Thread Marco Bambini
From the documentation: "If the progress callback returns a result other than 0, then the current query is immediately terminated...", so next time I call sqlite3_step what is the error returned? SQLITE_ERROR or SQLITE_ABORT or something else? Thanks a lot. --- Marco Bambini

[sqlite] problem with blobs (perl code)

2005-11-30 Thread Jim Dodgen
I am having a problem with blobs, I seem to insert ok but only get three (3) bytes when I query it back. yes I am setting LongReadLen. any ideas? thanks Jim I'm using sqlite 3.2.7, 1.09 and of the perl module also code and test results are below. also when I use the command line sqlite3 I

[sqlite] Re: Concurrency handling question

2005-11-30 Thread Igor Tandetnik
Doug Nebeker wrote: I've written a C++ wrapper for SQLite which has been working great. Lately though I've started getting what might be deadlocks when running two threads against the same database. One thread is a reader and the other is a writer (at the moment, I'm getting 'database locked'

Re: [sqlite] Concurrency handling question

2005-11-30 Thread drh
Doug Nebeker <[EMAIL PROTECTED]> wrote: > Thanks for the input Ned--I thought there had to be more going on. > > After reading about BEGIN TRANSACTION some more, it seems like some > times my retry strategy works (a reader gets SQLITE_BUSY because a > writer is holding an exclusive lock, in

RE: [sqlite] Concurrency handling question

2005-11-30 Thread Doug Nebeker
Thanks for the input Ned--I thought there had to be more going on. After reading about BEGIN TRANSACTION some more, it seems like some times my retry strategy works (a reader gets SQLITE_BUSY because a writer is holding an exclusive lock, in which case retrying the same sqlite3_ call later in

RE: [sqlite] Concurrency handling question

2005-11-30 Thread Ned Batchelder
You can't simply loop on retrying the last sqlite3_* call. You need to rollback one of the transactions and retry the entire transaction. Your two threads are deadlocked because (roughly) each has acquired a lock that the other needs. One needs to release the locks it holds. Rolling back is

[sqlite] Concurrency handling question

2005-11-30 Thread Doug Nebeker
I've written a C++ wrapper for SQLite which has been working great. Lately though I've started getting what might be deadlocks when running two threads against the same database. One thread is a reader and the other is a writer (at the moment, I'm getting 'database locked' errors, but that's