Re: [sqlite] Second sqlite3_prepare_v2() call fails on iOS path-based databases

2011-01-31 Thread Afriza N. Arief
On Tue, Feb 1, 2011 at 3:38 AM, Tito Ciuro wrote: > Hello, > > The following code snippet runs fine on Mac OS X, but fails on the iOS > simulator: > >// Obtain a path for the database >NSString *docs = > [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,

[sqlite] SQLite version 3.7.5

2011-01-31 Thread Richard Hipp
SQLite version 3.7.5 is now available on the SQLite website http://www.sqlite.org/ Version 3.7.5 is a regularly scheduled bi-monthly release. However, upgrading is recommended due to an obscure bug fix that can under contrived conditions result in a corrupt database. See

[sqlite] sqlite3 version 3.7.5: documentation of the "-heap" option

2011-01-31 Thread Oliver Peters
in the 3.7.5 releaselog (http://sqlite.org/releaselog/3_7_5.html) it is written that the "-heap" option was added to the CLI but if I follow http://sqlite.org/sqlite.html there is no further explanation. calling doesn't uncover information about this option too Oliver

Re: [sqlite] Bug? 3.7.5 RC2 FTS4 division by zero exception

2011-01-31 Thread Richard Hipp
On Mon, Jan 31, 2011 at 6:44 PM, Samuel Adam wrote: > On Mon, 31 Jan 2011 18:08:41 -0500, Ralf Junker wrote: > > > This SQL: > > > > drop table if exists t11; > > CREATE VIRTUAL TABLE t11 USING fts4; > > INSERT INTO t11

Re: [sqlite] Bug? 3.7.5 RC2 FTS4 division by zero exception

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 18:08:41 -0500, Ralf Junker wrote: > This SQL: > > drop table if exists t11; > CREATE VIRTUAL TABLE t11 USING fts4; > INSERT INTO t11 VALUES('quitealongstringoftext'); > INSERT INTO t11 VALUES('anotherquitealongstringoftext'); > UPDATE t11_stat

[sqlite] Bug? 3.7.5 RC2 FTS4 division by zero exception

2011-01-31 Thread Ralf Junker
This SQL: drop table if exists t11; CREATE VIRTUAL TABLE t11 USING fts4; INSERT INTO t11 VALUES('quitealongstringoftext'); INSERT INTO t11 VALUES('anotherquitealongstringoftext'); UPDATE t11_stat SET value = X''; SELECT matchinfo(t11, 'nxa') FROM t11 WHERE t11 MATCH 'a*'; leads

Re: [sqlite] Second sqlite3_prepare_v2() call fails on iOS path-based databases

2011-01-31 Thread Tito Ciuro
Hello Simon, On Jan 31, 2011, at 8:29 PM, Simon Slavin wrote: > > On 31 Jan 2011, at 7:55pm, Tito Ciuro wrote: > >> What do you mean by "no further"? In my app, I use both statements. I have >> trimmed down the code in this email thread to show the error. Be sure I use >> these two

Re: [sqlite] Second sqlite3_prepare_v2() call fails on iOS path-based databases

2011-01-31 Thread Simon Slavin
On 31 Jan 2011, at 7:55pm, Tito Ciuro wrote: > What do you mean by "no further"? In my app, I use both statements. I have > trimmed down the code in this email thread to show the error. Be sure I use > these two statements later on. The reason I cache the statements is to save > time during

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 15:33:24 -0500, Gabe da Silveira wrote: > On Mon, Jan 31, 2011 at 7:42 PM, Samuel Adam wrote: > >> I suggested rewriting your schema. Non-TEXT data which will not be >> subjected to a MATCH search is best stored in another table

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Gabe da Silveira
Here's a standalone script that provides an id field with an int on my local OS X machine as I desire, and creates an id field with text when run on the Gentoo machine as breaks the [difficult-to-patch] application: https://gist.github.com/aae2366637c94a2861ae Going home for the night now

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Gabe da Silveira
On Mon, Jan 31, 2011 at 7:42 PM, Samuel Adam wrote: > I suggested rewriting your schema.  Non-TEXT data which will not be > subjected to a MATCH search is best stored in another table and JOINed > with the FTS3 table, as Mr. Hess also explained.  Also, specifications > such

Re: [sqlite] Second sqlite3_prepare_v2() call fails on iOS path-based databases

2011-01-31 Thread Tito Ciuro
Hi Simon, On Jan 31, 2011, at 5:49 PM, Simon Slavin wrote: > > On 31 Jan 2011, at 7:38pm, Tito Ciuro wrote: > >> So my question I have is, why would the second sqlite3_prepare_v2 statement >> fail only on path-based iOS apps? :-/ > > The other question is: Is it permissable to have two

Re: [sqlite] Second sqlite3_prepare_v2() call fails on iOS path-based databases

2011-01-31 Thread Simon Slavin
On 31 Jan 2011, at 7:38pm, Tito Ciuro wrote: > So my question I have is, why would the second sqlite3_prepare_v2 statement > fail only on path-based iOS apps? :-/ The other question is: Is it permissable to have two statements prepared but no further, for the same database connection. Simon.

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 14:05:15 -0500, Gabe da Silveira wrote: [...] > On Mon, Jan 31, 2011 at 1:24 PM, Samuel Adam wrote: [...] >>* Is the database being populated with parameter binding, or >> not? If so, >> is id being bound as

[sqlite] Second sqlite3_prepare_v2() call fails on iOS path-based databases

2011-01-31 Thread Tito Ciuro
Hello, The following code snippet runs fine on Mac OS X, but fails on the iOS simulator: // Obtain a path for the database NSString *docs = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; NSString *path = [[docs

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Gabe da Silveira
On Mon, Jan 31, 2011 at 5:34 PM, Samuel Adam wrote: > According to the docs, results from those queries should be reversed.  I > suspect that Mr. da Silveira’s different platforms actually have different > SQLite versions, and that one version is consistent with the docs

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Gabe da Silveira
First of all, thank ou both Simon and Samuel for such thorough consideration of this problem. I've been in meetings all afternoon (London time) and will respond to each email where appropriate in turn... On Mon, Jan 31, 2011 at 1:24 PM, Samuel Adam wrote: > On Mon, 31 Jan

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 13:37:35 -0500, Samuel Adam wrote: > The FTS3 > columns declared INTEGER indeed seem to behave as regular INTEGER columns > in regular, non-MATCH queries (although I did not test to see if affinity > would coerce a '1' to INTEGER on insertion). No

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 13:16:55 -0500, Scott Hess wrote: > The FTS3 code mostly passes values directly down to and up from the > underlying tables, so if you bound an integer, it is likely to come > back out as an integer when you query. Just to be clear: In the tests I posted

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Scott Hess
On Mon, Jan 31, 2011 at 9:15 AM, Samuel Adam wrote: > On Mon, 31 Jan 2011 11:46:21 -0500, Samuel Adam wrote: >> On Mon, 31 Jan 2011 11:05:13 -0500, Simon Slavin >> wrote: >>> In the definition given in the original post, which I

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 12:34:24 -0500, Samuel Adam wrote: > According to the docs, results from those queries should be reversed. I > suspect that Mr. da Silveira’s different platforms actually have > different SQLite versions, and that one version is consistent with the

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 06:30:55 -0500, Gabe da Silveira wrote: > I have an issue with an fts3 table sqlite 3.6.22. I have a PHP script > that builds an sqlite3 client database for a ps3 application. > Depending on where I run the build the script (Gentoo or Mac OS X) I > get

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Simon Slavin
On 31 Jan 2011, at 5:15pm, Samuel Adam wrote: > Spoke too soon. SQLite actually ignores the PK definition, and does *not* > use "id" as an alias for the rowid. Evidence coming in another post; I > think I found a bug. Oooh. Interesting. Simon.

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 11:46:21 -0500, Samuel Adam wrote: > On Mon, 31 Jan 2011 11:05:13 -0500, Simon Slavin > wrote: > >> In the definition given in the original post, which I quoted, the table >> was defined as follows: >> >>> CREATE VIRTUAL TABLE

Re: [sqlite] Cause of "disk I/O errors"

2011-01-31 Thread Teg
Hello GHCS, Most common problem my users have is Virus scanners stepping on my writes. Might suggest they tell their Virus scanners to ignore your data folder. People do run out of disk space fairly frequently. I wouldn't discount it out of hand. C Sunday, January 30, 2011, 8:25:48 PM, you

Re: [sqlite] Bus error on sqlite3_close on Sun Sparc w/SQLite 3.7.4

2011-01-31 Thread Christian Smith
On Wed, Jan 26, 2011 at 02:31:05PM -0500, Joe Mokos wrote: > I've written an application that uses SQLite 3.7.4. The application runs > fine on WinXP, AIX, HPUX and Linux. When I try to run on Solaris 5.8 SPARC > I get a bus error when I call sqlite3_close. I get the following stack > trace: >

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 11:05:13 -0500, Simon Slavin wrote: > In the definition given in the original post, which I quoted, the table > was defined as follows: > >> CREATE VIRTUAL TABLE Directors USING fts3(id INTEGER PRIMARY KEY NOT >> NULL, first_name TEXT NOT NULL,

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Simon Slavin
On 31 Jan 2011, at 2:26pm, Samuel Adam wrote: > On Mon, 31 Jan 2011 08:44:22 -0500, Simon Slavin > wrote: > >> On 31 Jan 2011, at 1:24pm, Samuel Adam wrote: > [snip] >>> Actually since this is an FTS3 table, the form with the quotes is the >>> correct one. As Mr. da

Re: [sqlite] "Next" record

2011-01-31 Thread Ian Hardingham
Great, thanks Igor. On 31/01/2011 14:45, Igor Tandetnik wrote: > Ian Hardingham wrote: >> I wish to get the "next" record of a certain type, such that if we have >> row Id x, then: >> >> Select the minimum id such that id> x (with some WHERE conditions) >> If there is no such

Re: [sqlite] "Next" record

2011-01-31 Thread Igor Tandetnik
Ian Hardingham wrote: > I wish to get the "next" record of a certain type, such that if we have > row Id x, then: > > Select the minimum id such that id > x (with some WHERE conditions) > If there is no such id (ie x is the largest with the conditions) then > the first id with

[sqlite] "Next" record

2011-01-31 Thread Ian Hardingham
Hey guys. I wish to get the "next" record of a certain type, such that if we have row Id x, then: Select the minimum id such that id > x (with some WHERE conditions) If there is no such id (ie x is the largest with the conditions) then the first id with those conditions is returned. I'm doing

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 08:44:22 -0500, Simon Slavin wrote: > On 31 Jan 2011, at 1:24pm, Samuel Adam wrote: [snip] >> Actually since this is an FTS3 table, the form with the quotes is the >> correct one. As Mr. da Silveira alluded later in his post, in FTS3, the >> row ID

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Simon Slavin
On 31 Jan 2011, at 1:24pm, Samuel Adam wrote: > On Mon, 31 Jan 2011 07:27:23 -0500, Simon Slavin > wrote: > >> On 31 Jan 2011, at 11:30am, Gabe da Silveira wrote: >>> >>> CREATE VIRTUAL TABLE Directors USING fts3(id INTEGER PRIMARY KEY NOT >>> NULL, first_name TEXT NOT

Re: [sqlite] WAL for single user database on NFS and Solaris

2011-01-31 Thread Dan Kennedy
On 01/31/2011 11:53 AM, Shawn Wilsher wrote: > On Sun, Jan 30, 2011 at 8:26 PM, Dan Kennedy wrote: >> If you set "PRAGMA locking_mode=EXCLUSIVE" before reading or >> writing the WAL-mode database it might work. > That would make us only be able to use one database

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Samuel Adam
On Mon, 31 Jan 2011 07:27:23 -0500, Simon Slavin wrote: > On 31 Jan 2011, at 11:30am, Gabe da Silveira wrote: > >> I have a PHP script >> that builds an sqlite3 client database for a ps3 application. >> Depending on where I run the build the script (Gentoo or Mac OS X) I

Re: [sqlite] integer or string in fts3 table

2011-01-31 Thread Simon Slavin
On 31 Jan 2011, at 11:30am, Gabe da Silveira wrote: > I have a PHP script > that builds an sqlite3 client database for a ps3 application. > Depending on where I run the build the script (Gentoo or Mac OS X) I > get a database file that has different semantics for a column declared > as an

[sqlite] integer or string in fts3 table

2011-01-31 Thread Gabe da Silveira
I have an issue with an fts3 table sqlite 3.6.22. I have a PHP script that builds an sqlite3 client database for a ps3 application. Depending on where I run the build the script (Gentoo or Mac OS X) I get a database file that has different semantics for a column declared as an integer pk: CREATE

Re: [sqlite] WAL for single user database on NFS and Solaris

2011-01-31 Thread Shawn Wilsher
On Sun, Jan 30, 2011 at 8:26 PM, Dan Kennedy wrote: > If you set "PRAGMA locking_mode=EXCLUSIVE" before reading or > writing the WAL-mode database it might work. That would make us only be able to use one database connection though, would it not? Cheers, Shawn