Re: [sqlite] sqlite support for geometric column types?

2011-11-26 Thread Alexey Pechnikov
2011/11/26 Peter Aronson : > Not directly.  But Alessandro Furieri has created a version of SQLite with > OGC conforming geometry columns, called SpatiaLite.  It can be found here: > > http://www.gaia-gis.it/spatialite/ > > It's based on an older version of SQLite (3.6.16, but a

Re: [sqlite] Free c code for embedded sqlite3

2011-11-26 Thread Matt Young
Good idea, as soon as I figure out how it works! On Wed, Nov 23, 2011 at 2:41 PM, Nico Williams wrote: > Docs would help people understand what you're up to... > > Nico > -- > ___ > sqlite-users mailing list >

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Simon Slavin
On 26 Nov 2011, at 4:00pm, Jean-Christophe Deschamps wrote: >> So I make up for it by using an 'exec' which executes only the first >> command, and by hashing the command so that tampering with it would make it >> fail the hash. > > AFAIK sqlite3_exec will hapilly prepare and run more than

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Jean-Christophe Deschamps
So I make up for it by using an 'exec' which executes only the first command, and by hashing the command so that tampering with it would make it fail the hash. AFAIK sqlite3_exec will hapilly prepare and run more than one statements in a row. I use it all the time. But there's no reason

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 25/11/11 02:07, joel.bertr...@external.gdfsuez.com wrote: > If sqlite3_step() returns BUSY_TIMEOUT, I try to restart statement : > > While((result = sqlite3_step(stmt)) == SQLITE_BUSY) { Usleep(_random > [0s, 1s[_); } Is there any particular

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Jean-Christophe Deschamps
And it's convenient to be able to do the prepare during startup. I've just never had to worry about this situation. It means you have to do special handling for the first _step, but it's a reasonably compact way of handling the potential problem. I can't use prepared statements in

Re: [sqlite] Cross-platform Intel <-> ARM sqlite file issue...

2011-11-26 Thread Kees Nuyt
On Fri, 25 Nov 2011 12:30:10 +0100, Laurent PERROTON wrote: > I am having a cross-platform Intel/ARM sqlite file issue. > > "...the file format is cross-platform. A database that is created on one > machine can be copied and used on a different machine with a different >

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Simon Slavin
On 26 Nov 2011, at 2:29pm, Jean-Christophe Deschamps wrote: > Hi Simon, > >> Ah, so it's the first _step which does the locking, rather than the _prepare. > > That makes sense to me. If I had a serious application using, say, a hundred > of different prepared queries, I'd rather

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Jean-Christophe Deschamps
Hi Simon, Ah, so it's the first _step which does the locking, rather than the _prepare. That makes sense to me. If I had a serious application using, say, a hundred of different prepared queries, I'd rather batch-prepare them all up front then use them when needed without asking question.

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Simon Slavin
On 26 Nov 2011, at 2:15pm, Pavel Ivanov wrote: > On Sat, Nov 26, 2011 at 9:03 AM, Simon Slavin wrote: >> On 26 Nov 2011, at 2:00pm, Pavel Ivanov wrote: >> >>> When sqlite3_step returned SQLITE_BUSY you have to call sqlite3_reset >>> before calling sqlite3_step again. >>

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Pavel Ivanov
On Sat, Nov 26, 2011 at 9:03 AM, Simon Slavin wrote: > On 26 Nov 2011, at 2:00pm, Pavel Ivanov wrote: > >> When sqlite3_step returned SQLITE_BUSY you have to call sqlite3_reset >> before calling sqlite3_step again. > > If your statement is a SELECT returning 50 rows, and

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Jean-Christophe Deschamps
If your statement is a SELECT returning 50 rows, and you've already read 20 of them by the time you get the _BUSY, do you get the first 20 again after doing the _reset ? I don't believe we can get _BUSY in the middle of a SELECT. Am I wrong?

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Simon Slavin
On 26 Nov 2011, at 2:00pm, Pavel Ivanov wrote: > When sqlite3_step returned SQLITE_BUSY you have to call sqlite3_reset > before calling sqlite3_step again. If your statement is a SELECT returning 50 rows, and you've already read 20 of them by the time you get the _BUSY, do you get the first 20

Re: [sqlite] SQLITE_BUSY

2011-11-26 Thread Pavel Ivanov
> While((result = sqlite3_step(stmt)) == SQLITE_BUSY) > { >                Usleep(_random [0s, 1s[_); > } When sqlite3_step returned SQLITE_BUSY you have to call sqlite3_reset before calling sqlite3_step again. So your loop should look like this: While((result = sqlite3_step(stmt)) ==

[sqlite] Cross-platform Intel <-> ARM sqlite file issue...

2011-11-26 Thread Laurent PERROTON
Hello Everybody, I am having a cross-platform Intel/ARM sqlite file issue. "...the file format is cross-platform. A database that is created on one machine can be copied and used on a different machine with a different architecture." So, how come I get this (sqlite 3.5.9 and ext3 on both