Re: [sqlite] attach in transaction

2007-01-08 Thread Darren Duncan
At 3:42 PM + 1/8/07, [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Can someone tell me why attach cannot be called within transaction? I do not recall. Clearly a DETACH will not work inside a transaction if the table being detached has been accessed or modified within that

Re: [sqlite] Shared cache mode issue

2007-01-08 Thread Jay Sprenkle
On 1/8/07, Peter James <[EMAIL PROTECTED]> wrote: Thanks for your response, Ken. I'm not sure I've explained myself properly. It's not that I'm calling sqlite3_enable_shared_cache() multiple times. It's that if I don't maintain a persistent connection while the server is running I end up with

Re: [sqlite] Segfault on sqlite3_reset

2007-01-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Roger Binns wrote: > [EMAIL PROTECTED] wrote: >> http://www.sqlite.org/cvstrac/tktview?tn=2154 and >> http://www.sqlite.org/cvstrac/chngview?cn=3576 > >> Version 3.3.10 is nigh upon us. Prior to then, I appreciate any >> testing you can do with the

Re: [sqlite] Segfault on sqlite3_reset

2007-01-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: > http://www.sqlite.org/cvstrac/tktview?tn=2154 and > http://www.sqlite.org/cvstrac/chngview?cn=3576 > > Version 3.3.10 is nigh upon us. Prior to then, I appreciate any > testing you can do with the latest code out of CVS.

Re: [sqlite] Shared cache mode issue

2007-01-08 Thread Peter James
On 1/8/07, Ken <[EMAIL PROTECTED]> wrote: You could always implement a sqlite3_open call and store it in the g variable, and close it when the server quits. Thanks for your response, Ken. I'm not sure I've explained myself properly. It's not that I'm calling sqlite3_enable_shared_cache()

Re: [sqlite] Segfault on sqlite3_reset

2007-01-08 Thread drh
Ken <[EMAIL PROTECTED]> wrote: > If sqlite3_finalize is the destructor, then what happens when it > returns sqlite3_busy ? > > Should finalize be called again? > sqlite3_finalize always succeeds. The return code is the detailed return code from the most recent call to sqlite3_step(). -- D.

Re: [sqlite] Shared cache mode issue

2007-01-08 Thread Ken
Here is a code snipet from my version if the server thread code I found that it was doing an enable/disable on the shared cache with the original logic. You could always implement a sqlite3_open call and store it in the g variable, and close it when the server quits. void

Re: [sqlite] Segfault on sqlite3_reset

2007-01-08 Thread Ken
If sqlite3_finalize is the destructor, then what happens when it returns sqlite3_busy ? Should finalize be called again? Thanks [EMAIL PROTECTED] wrote: Ken wrote: > sqlite3_step > sqlite3_finalize > sqlite3_reset > > Ok I think I know.. the reset should not have been called.

Re: [sqlite] Segfault on sqlite3_reset

2007-01-08 Thread drh
Ken <[EMAIL PROTECTED]> wrote: > sqlite3_step > sqlite3_finalize > sqlite3_reset > > Ok I think I know.. the reset should not have been called. Right. Finalize is the destructor for the sqlite3_stmt object. Bad things happen when you try to call a method on an object which has already been

Re: [sqlite] Segfault on sqlite3_reset

2007-01-08 Thread Ken
sqlite3_step -> Jan 8 16:50:49 | CRITICAL | test3_proc | Error: Error fetching cursor=[sel_proc] db=[tst_sqlitethrd.db] rc=[5] msg=[database is locked] sqlite3_finalize -> Jan 8 16:50:49 | CRITICAL | test3_proc | Error: Error closing cursor=[sel_proc] db=[tst_sqlitethrd.db]

Re: [sqlite] Segfault on sqlite3_reset

2007-01-08 Thread drh
Ken <[EMAIL PROTECTED]> wrote: > Found the issue: > > > Called sqlite3_finalize after recieving a SQLITE_BUSY on on sqlite3_step, > then you get a segfault and all sorts of errors, glibc related. > Unable to reproduce, even before the most recent corrections to sqlite3_prepare_v2().

Re: [sqlite] Segfault on sqlite3_reset

2007-01-08 Thread Ken
Found the issue: Called sqlite3_finalize after recieving a SQLITE_BUSY on on sqlite3_step, then you get a segfault and all sorts of errors, glibc related. But if I loop on SQLITE_BUSY, re-calling the sqlite3_step all is well. Can this be the correct thing to do ??? I mean I alreaded

Re: [sqlite] Segfault on sqlite3_reset

2007-01-08 Thread drh
Ken <[EMAIL PROTECTED]> wrote: > I'm getting a segfault and sigabort (sporadic) when calling sqlite3_reset. > > Version 3.3.9 and using sqlite3_prepare_v2... > You're late to the party, Ken. See http://www.sqlite.org/cvstrac/tktview?tn=2154 and

[sqlite] Segfault on sqlite3_reset

2007-01-08 Thread Ken
I'm getting a segfault and sigabort (sporadic) when calling sqlite3_reset. Version 3.3.9 and using sqlite3_prepare_v2... I'll retest using sqlite3_prepare. Ken

Re: [sqlite] attach in transaction

2007-01-08 Thread Derrell . Lipman
[EMAIL PROTECTED] writes: > The prohibition against running ATTACH within transaction > first appeared in version 3.0.1. Presumably in version 3.0.0 > you could ATTACH within a transaction. The prohibition may have appeared in 3.x but attempting an ATTACH within a transaction doesn't work with

Re: [sqlite] attach in transaction

2007-01-08 Thread Nicolas Williams
On Mon, Jan 08, 2007 at 03:42:47PM +, [EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > Can someone tell me why attach cannot be called within transaction? > > I do not recall. > > Clearly a DETACH will not work inside a transaction if the > table being detached has been accessed or

[sqlite] Problem with prepare_v2?

2007-01-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I found what appears to be a problem when using prepare_v2 and there is a SCHEMA error that makes it do a re-prepare. Firstly I want to confirm that this is a valid way of re-using a statement: sqlite3_prepare(.. stmt ..); sqilte3_step(stmt);

[sqlite] Re: Trigger UPDATE OF problems

2007-01-08 Thread Igor Tandetnik
jfbaro wrote: We need to use a trigger to update the column sync into a table when any column is changed (except the sync column itself), so by looking in the SQLite website we came across that: CREATE TRIGGER syncTransactions AFTER UPDATE OF transactionId, transactionJourneyId,

Re: [sqlite] how would you allow users to re-order rows arbitrarily?

2007-01-08 Thread Dennis Cote
Sean Payne wrote: Suppose gui-users wanted to drag and drop rows in a table so that they could shuffle it anyway that they wanted so that the rows maintained that order the next time they accessed the table. Can this be done without updating alot of other rows? How is this normally handled?

Re: [sqlite] strange %W behavior

2007-01-08 Thread drh
Martin Jenkins <[EMAIL PROTECTED]> wrote: > Joe Wilson wrote: > > --- Will Leshner <[EMAIL PROTECTED]> wrote: > > > >> In the current release of SQLite (3.3.9) I find that if I execute the > >> following query multiple times in succession I get different values > >> for %W: > >> > >> SELECT

Re: [sqlite] Trigger UPDATE OF problems

2007-01-08 Thread Dan Kennedy
On Mon, 2007-01-08 at 06:55 -0800, jfbaro wrote: > Hi, > > We need to use a trigger to update the column sync into a table when any > column is changed (except the sync column itself), so by looking in the > SQLite website we came across that: > > CREATE TRIGGER syncTransactions AFTER > UPDATE

Re: [sqlite] strange %W behavior

2007-01-08 Thread Martin Jenkins
Joe Wilson wrote: --- Will Leshner <[EMAIL PROTECTED]> wrote: In the current release of SQLite (3.3.9) I find that if I execute the following query multiple times in succession I get different values for %W: SELECT strftime('%Y-%W', 'now'); Sometimes the value is '2007-02' and other times

Re: [sqlite] attach in transaction

2007-01-08 Thread drh
[EMAIL PROTECTED] wrote: > > Can someone tell me why attach cannot be called within transaction? I do not recall. Clearly a DETACH will not work inside a transaction if the table being detached has been accessed or modified within that transaction. But ATTACH could work, I would think.

[sqlite] attach in transaction

2007-01-08 Thread BardzoTajneKonto
Hi Can someone tell me why attach cannot be called within transaction? It does change internal structures, but id doesn't change any tables. And even if it would have, I think changing tables in the same connection should be allowed. Wiktor Adamski

[sqlite] Trigger UPDATE OF problems

2007-01-08 Thread jfbaro
Hi, We need to use a trigger to update the column sync into a table when any column is changed (except the sync column itself), so by looking in the SQLite website we came across that: CREATE TRIGGER syncTransactions AFTER UPDATE OF transactionId, transactionJourneyId, transactionDeviceId,

[sqlite] Re: What about Foreign Key support (when?)

2007-01-08 Thread Marc Ruff
* Aristotle Pagaltzis wrote: >You can use triggers to enforce FKs until they are natively enforced: >http://www.justatheory.com/computers/databases/sqlite/foreign_key_triggers. html >http://www.rcs-comp.com/site/index.php/view/Utilities-SQLite_foreign_key_tr igger_generator Thanks for this info.