Re: [sqlite] When do I need SQLITE_THREADSAFE?

2010-10-04 Thread Jay A. Kreibich
On Mon, Oct 04, 2010 at 07:25:05PM -0700, Dustin Sallings scratched on the wall: > > On Oct 4, 2010, at 14:46, Jay A. Kreibich wrote: > > > If you're treating the threads independently, each with their own > > database connections, you should be safe with =2 ("multithread"). > > That

Re: [sqlite] When do I need SQLITE_THREADSAFE?

2010-10-04 Thread Drake Wilson
Quoth Dustin Sallings , on 2010-10-04 19:25:05 -0700: > I did read that, but I didn't quite understand what the global state > is that will be accessed between otherwise independent > threads. Reading the code makes that a bit more clear. Consider things like how POSIX file locks

Re: [sqlite] When do I need SQLITE_THREADSAFE?

2010-10-04 Thread Dustin Sallings
On Oct 4, 2010, at 14:46, Jay A. Kreibich wrote: > If you're treating the threads independently, each with their own > database connections, you should be safe with =2 ("multithread"). > That provides less protection than =1 ("serialized"), but it is also > faster. Continued from above: >

Re: [sqlite] errors after sqlite3_step

2010-10-04 Thread Simon Slavin
On 4 Oct 2010, at 10:52pm, Jay A. Kreibich wrote: > For good or for bad, this is the behavior of both sqlite3_open() and > sqlite3_open_v2(). I'm sure you'd see the same thing with all VFS > modules. > > http://www.sqlite.org/c3ref/open.html > > It seems odd to me as well, especially

Re: [sqlite] errors after sqlite3_step

2010-10-04 Thread Jay A. Kreibich
On Mon, Oct 04, 2010 at 02:40:45PM -0700, Dave Dyer scratched on the wall: > (I'm a little curious about the logic in unixOpen, which if a > read/write open fails, tries a readonly open instead. I'm unsure > how this is supposed to be acceptable. For good or for bad, this is the behavior of

Re: [sqlite] When do I need SQLITE_THREADSAFE?

2010-10-04 Thread Jay A. Kreibich
On Mon, Oct 04, 2010 at 02:17:06PM -0700, Dustin Sallings scratched on the wall: > > I've read the documentation, but one thing that was unclear: > > Do I need SQLITE_THREADSAFE=2 (or 1) when I am using sqlite >from two different threads entirely independently in a >

Re: [sqlite] errors after sqlite3_step

2010-10-04 Thread Dave Dyer
I've collected a little more information about this problem. At the low level sqlite3_step is going through "pagerSharedLock" and ultimately to unixOpen, which is returning unix errno=2 for the journal file. -- presumably at this point, the journal file is known to exist, so error 2 ought to

Re: [sqlite] errors after sqlite3_step

2010-10-04 Thread Dave Dyer
I've collected a little more information about this problem. At the low level sqlite3_step is going through "pagerSharedLock" and ultimately to unixOpen, which is returning unix errno=2 for the journal file. -- presumably at this point, the journal file is known to exist, so error 2 ought to

Re: [sqlite] Delete from A what is not in B

2010-10-04 Thread Max Vlasov
On Sat, Oct 2, 2010 at 4:02 PM, Igor Tandetnik wrote: > Fadhel Al-Hashim wrote: > > I have two tables that contain about 5 million records. I am trying to > write > > an SQL command to delete rows from table A with PK (x,y,z) where PK > (x,y,z) > > is not

[sqlite] When do I need SQLITE_THREADSAFE?

2010-10-04 Thread Dustin Sallings
I've read the documentation, but one thing that was unclear: Do I need SQLITE_THREADSAFE=2 (or 1) when I am using sqlite from two different threads entirely independently in a single-threaded manner? That is, no information sharing between them from my application.

Re: [sqlite] SQLite working with C++'s iostream

2010-10-04 Thread Richard Hipp
On Mon, Oct 4, 2010 at 1:53 AM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 10/03/2010 10:01 PM, Max Vlasov wrote: > > On Sun, Oct 3, 2010 at 7:21 PM, Roger Binns > wrote: > > > >> > >> Also note that xTruncate may be

Re: [sqlite] SQLite working with C++'s iostream

2010-10-04 Thread Jay A. Kreibich
On Sun, Oct 03, 2010 at 06:31:41PM +0200, Pierre Krieger scratched on the wall: > But the main reason why I would use streams is for other things like > reading data from a socket or decrypting a file on-the-fly for example > (these are just ideas) SQLite has some very specific requirements

Re: [sqlite] upstreaming Chromium patches for file handle passing support

2010-10-04 Thread Paweł Hajdan , Jr .
On Tue, Aug 31, 2010 at 19:51, Richard Hipp wrote: > My suggestion is that you make a copy of the os_unix.c source file (call it > chromium_vfs.c or anything else that you like) and apply your edits to that > copy. FYI, that's what finally happened.

Re: [sqlite] Delete from A what is not in B

2010-10-04 Thread Fadhel Al-Hashim
yes PRIMARY KEY (x,y,z) On Sat, Oct 2, 2010 at 9:10 PM, Simon Slavin wrote: > > On 2 Oct 2010, at 1:15pm, Fadhel Al-Hashim wrote: > > > I did not add indices on those columns assuming that being PK is enough? > is > > that right? > > How did you define the primary keys ?

Re: [sqlite] Accented characters and ODBC

2010-10-04 Thread Christian Werner
Greg Bryant wrote: > > Not sure if ODBC questions belong here, feel free to point me to a better > forum. > > I'm using current SQLite (3.7.2) via a visual c++ app. We're connecting a > sqlite3 database via ODBC (driver from , also current version - 0.87). If I > do either an insert or update

Re: [sqlite] SQLite working with C++'s iostream

2010-10-04 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/03/2010 10:01 PM, Max Vlasov wrote: > On Sun, Oct 3, 2010 at 7:21 PM, Roger Binns wrote: > >> >> Also note that xTruncate may be called to make a file longer. >> >> > Roger, are you sure about that? That has certainly

Re: [sqlite] EXTERNAL:Re: FTS Question (hyphenated words).

2010-10-04 Thread Dami Laurent (PJ)
>-Message d'origine- >De : sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] De la part de Black, Michael (IS) >Envoyé : dimanche, 3. octobre 2010 14:02 >À : General Discussion of SQLite Database >Objet : Re: [sqlite] EXTERNAL:Re: FTS Question > >OK...that make

Re: [sqlite] SQLite working with C++'s iostream

2010-10-04 Thread Max Vlasov
On Sun, Oct 3, 2010 at 7:21 PM, Roger Binns wrote: > > Also note that xTruncate may be called to make a file longer. > > Roger, are you sure about that? My own experience with VFS showed that expanding was always handled by xWrite pointing to the offset outside the current