[sqlite] Proxy locking and NFS

2009-03-04 Thread Jim Ursetto
Hello. The new Proxy Locking code for OS X says it is intended for AFP filesystems, but it seems it also addresses a cache coherency issue on NFS in general. Is that the case, and if so, should the option be made available for other UNIX systems? I am thinking of modifying my copy to allow it.

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread Marcus Grimm
Hi Ken, yes, I do check the return values also for the sqlite3_prepare_v2 call. This is allways successful, the first sqlite_step call right after this one returns the magic MISSUSE. Yes, I also tried to call sqlite_reset right after this first error and in this case sqlite_reset return the LOCK

Re: [sqlite] Foreign key support

2009-03-04 Thread BareFeet
Hi Dan, >> According to the readme: >> http://www.sqlite.org/cvstrac/fileview?f=sqlite/tool/genfkey.README >> I should be able to run genfkey directly from within the command >> line tool, but it doesn't seem to work > The change to add the genfkey functionality to the shell is still in >

Re: [sqlite] Foreign key support

2009-03-04 Thread Dan
On Mar 5, 2009, at 10:25 AM, BareFeet wrote: > Hi all, > >>> It is true that triggers can be used to achieve referential >>> integrity. >>> However you don't have to hand craft them. > >>> the SQLite team has already done all the work for you. The SQLite >>> source includes a program named

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread Ken
Marcus, I'm not sure if this will help or not... But I noticed your sample code does not test the return value from the sqlite3_prepare_v2 call. Could the code be entering the do loop when an error was returned from prepare? Just an idea. Have you tried the reset call as DRH had suggested?

Re: [sqlite] Double entry bookkeeping

2009-03-04 Thread BareFeet
Hi all, Below the basic SQL schema I have so far for double entry bookkeeping. Does this look like a viable schema? I think I'm interpreting the general structure of double entry bookkeeping and earlier discussion here correctly. I welcome any comments specifically on the schema. Basically

Re: [sqlite] Foreign key support

2009-03-04 Thread BareFeet
Hi all, >> It is true that triggers can be used to achieve referential >> integrity. >> However you don't have to hand craft them. >> the SQLite team has already done all the work for you. The SQLite >> source includes a program named 'genfkey' that will create the >> triggers. > So the

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread Marcus Grimm
Ken, you are of course right that it needs some checks for locks and busy states. I left that out to simplify the code given below. My original code checks that and it usually works quite well. that's basically the reason why I was puzzled by the randomly MISUSE results after I added the shared

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread Ken
Marcus, You might want to also add some checks in for sqlite_busy as on the result of the prepare and the first call to sqlite_step. On the inner loop test for the most common case first (SQLITE_ROW) then test for errors... Slight performance improvement... --- On Wed, 3/4/09, Marcus Grimm

Re: [sqlite] sqlite3 datbase disk image malformed

2009-03-04 Thread Tito Ciuro
Hi Dan, On Mar 4, 2009, at 9:21 AM, Dan wrote: > > On Mar 5, 2009, at 12:10 AM, Tito Ciuro wrote: > >> Hello, >> >> On Mar 4, 2009, at 6:06 AM, D. Richard Hipp wrote: >> >>> See http://www.sqlite.org/atomiccommit.html and especially section >>> 9.0 >>> "Things That Can Go Wrong" >> >> Reading

Re: [sqlite] sqlite3 datbase disk image malformed

2009-03-04 Thread Dan
On Mar 5, 2009, at 12:10 AM, Tito Ciuro wrote: > Hello, > > On Mar 4, 2009, at 6:06 AM, D. Richard Hipp wrote: > >> See http://www.sqlite.org/atomiccommit.html and especially section >> 9.0 >> "Things That Can Go Wrong" > > Reading the above link, I'm curious about a specific case: 4.2 Hot >

Re: [sqlite] sqlite3 datbase disk image malformed

2009-03-04 Thread Tito Ciuro
Hello, On Mar 4, 2009, at 6:06 AM, D. Richard Hipp wrote: > See http://www.sqlite.org/atomiccommit.html and especially section 9.0 > "Things That Can Go Wrong" Reading the above link, I'm curious about a specific case: 4.2 Hot Rollback Journals. It states that: [...] The first time that any

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread Marcus Grimm
Richard, thanks again for the feedback. However, I don't see how it can happend that the statement is completed internally without returning SQLITE_DONE. In the particular code of the "reading thread" I do something like: -- sqlite3_prepare_v2(db, "SELECT * FROM TableA", -1, , 0); /** step throu

Re: [sqlite] Bug in SQLITE? "Joins + Order By" Changing row count!?!

2009-03-04 Thread Dan
Create an sql dump using the ".dump" command of the sqlite3 shell tool: $ echo .dump | sqlite3 database_file.db > dump.sql Or just put the database file up for download somewhere. Or if you prefer, send it to me by email. If this bug is present in current versions, we need to fix it. But

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread D. Richard Hipp
On Mar 4, 2009, at 9:35 AM, Marcus Grimm wrote: > hi, > > OK, the value of p->magic is 519C2973 (VDBE_MAGIC_HALT) That means the prepared statement has run to completion and needs to be reset using sqlite3_reset() before you continue. D. Richard Hipp d...@hwaci.com

Re: [sqlite] Slow performance with Sum function

2009-03-04 Thread Alexey Pechnikov
Hello! On Wednesday 04 March 2009 17:19:09 Jim Wilcoxson wrote: > Have you tried changing the page size to 4096 or 8192?  Doing this > with my SQLite application and increasing the transaction size > decreased runtime from over 4 hours to 75 minutes.    The runtime for > my app writing the same

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread Marcus Grimm
hi, OK, the value of p->magic is 519C2973 (VDBE_MAGIC_HALT) that should mean that "VDBE has completed execution"... I don't know... in that case I should get a SQLITE_DONE when stepping throu the result set, right ? Just some additional info: It is the last sqlite version, threadsafe is true

Re: [sqlite] Slow performance with Sum function

2009-03-04 Thread Jim Wilcoxson
Have you tried changing the page size to 4096 or 8192? Doing this with my SQLite application and increasing the transaction size decreased runtime from over 4 hours to 75 minutes.The runtime for my app writing the same amount of data to flat files was 55 minutes, so the time penalty for

Re: [sqlite] Bug in SQLITE? "Joins + Order By" Changing row count!?!

2009-03-04 Thread Jonathon
Thanks Dan for the reply, How would I go about creating a sql dump? As for the ORDER BY clause, I do this: SELECT * FROM tableA a INNER JOIN tableB b INNER JOIN tableC c INNER JOIN tableD d LEFT JOIN tableE ON a.b_id = b.id AND a.c_id = c.id AND a.d_id = d.id AND c.e_id = e.id ORDER BY

Re: [sqlite] sqlite3 datbase disk image malformed

2009-03-04 Thread D. Richard Hipp
On Mar 4, 2009, at 7:41 AM, donnied wrote: > > I have a very small sql database (132K). I will often get error > messages > that the Disk image is malformed. I've looked over possible causes > cited > elsewhere and didn't see anything pertinent. I'm using an ext3 file > system > with 64

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread D. Richard Hipp
On Mar 4, 2009, at 8:31 AM, Marcus Grimm wrote: > Richard, > Thanks for looking into this. > > I've placed some debug output in the sqlite2_step function > and I found that it returns SQLITE_MISUSE here: > > -- > static int sqlite3Step(Vdbe *p){ > sqlite3 *db; > int rc; > > assert(p); >

Re: [sqlite] core dump with TKSQLite

2009-03-04 Thread Alexey Pechnikov
Hello! On Wednesday 04 March 2009 15:38:39 rahed wrote: > I doubt. To my acknowledge tksqlite is a tcl/tk script run from shell. The > source doesn't distinguish the platform. tksqlite.tcl is tcl script but you did write about tksqlite. tksqlite is binary file with tcl interp and virtual file

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread Marcus Grimm
Richard, Thanks for looking into this. I've placed some debug output in the sqlite2_step function and I found that it returns SQLITE_MISUSE here: -- static int sqlite3Step(Vdbe *p){ sqlite3 *db; int rc; assert(p); if( p->magic!=VDBE_MAGIC_RUN ) { return SQLITE_MISUSE;

[sqlite] sqlite3 datbase disk image malformed

2009-03-04 Thread donnied
I have a very small sql database (132K). I will often get error messages that the Disk image is malformed. I've looked over possible causes cited elsewhere and didn't see anything pertinent. I'm using an ext3 file system with 64 bit Debian. The files are created with Python (first one script

Re: [sqlite] core dump with TKSQLite

2009-03-04 Thread rahed
Alexey Pechnikov writes: > TkSQLite has it's own copies of SQLite2 and SQLite3 inside. I think you are > download TkSQLite for different platform. I doubt. To my acknowledge tksqlite is a tcl/tk script run from shell. The source doesn't distinguish the platform. I

Re: [sqlite] Is UPDATE with JOIN supported?

2009-03-04 Thread Petr Zizka
I am sorry, it is already solved. Finally I used the following syntax: UPDATE suppliers SET supplier_name =( SELECT customers.name FROM customers WHERE customers.customer_id =suppliers.supplier_id) Which works perfectly, needless to say. It was due to my SQL knowledge ignorance. P. On Wed, Mar

Re: [sqlite] core dump with TKSQLite

2009-03-04 Thread rahed
Alexey Pechnikov writes: > Hello! > TkSQLite has it's own copies of SQLite2 and SQLite3 inside. I think you are > download TkSQLite for different platform. I doubt. To my acknowledge tksqlite is a tcl/tk script run from shell. The source doesn't distinguish the

Re: [sqlite] Is UPDATE with JOIN supported?

2009-03-04 Thread Brad Stiles
> I am trying to do an UPDATE of one table based on the aggregate > results of the different table. How can I do it in SQlite please? What have you tried that didn't work? /bs ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread D. Richard Hipp
On Mar 4, 2009, at 5:19 AM, Marcus Grimm wrote: > Hi all, > > I'm doing a little stress test on a server application and run into > a problem when two threads are trying to access the database. > Here is the background: > 1. shared cache is enabled prior open any DB connection. > 2. Each thread

[sqlite] WHERE clause analysis - find referenced columns

2009-03-04 Thread Alex Ousherovitch
Hello list, I need to implement a security model where certain columns (e.g. named super_secret_key) will be hidden. This needs to be enforced not only for the requested result columns but also for the columns referenced in the WHERE clause. Is there a relatively simple way to either get

[sqlite] Does anybody have a working version of php_sqlite3.dll?

2009-03-04 Thread ZeWaren / Erwan Martin
Hello everyone. I hope I'm not violating any disclaimer posting this message. A few days ago I had to migrate my project from linux to windows. It is using the php sqlite3 extension, to access sqlite3 database files. Problem is, I can't find the extension dll (php_sqlite3.dll). I found one on a

[sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-04 Thread Marcus Grimm
Hi all, I'm doing a little stress test on a server application and run into a problem when two threads are trying to access the database. Here is the background: 1. shared cache is enabled prior open any DB connection. 2. Each thread then opens a DB connection. 3. Thread A just reads table

Re: [sqlite] Slow performance with Sum function

2009-03-04 Thread Alexey Pechnikov
Hello! On Wednesday 04 March 2009 04:44:05 D. Richard Hipp wrote: >  One could envision future versions   > of SQLite that allowed you to preallocate a large database files such   > that the database always stayed less than 80% full.  Then we could use   > filesystem techniques to keep

Re: [sqlite] core dump with TKSQLite

2009-03-04 Thread Alexey Pechnikov
Hello! On Tuesday 03 March 2009 17:04:32 rahed wrote: > I installed 3.6.11 on Solaris with 3_6_11-tea. > When I try to open sqlite db with tksqlite there is core dump: > > warning: core file may not match specified executable file. > Core was generated by `wish /export/home/user1/tksqlite'. >

[sqlite] Is UPDATE with JOIN supported?

2009-03-04 Thread Petr Zizka
Hello, I am trying to do an UPDATE of one table based on the aggregate results of the different table. How can I do it in SQlite please? Background problem: Table1 contains many different values of different file names. I've created view (table2) which provides me information how many file names

Re: [sqlite] Does anybody have a working version of php_sqlite3.dll?

2009-03-04 Thread Emil Obermayr
On Wed, Mar 04, 2009 at 09:05:34AM +0100, ZeWaren / Erwan Martin wrote: > > A few days ago I had to migrate my project from linux to windows. It is > using the php sqlite3 extension, to access sqlite3 database files. Use the "external" version of the PDO-sqlite and use the normal DLL from the

[sqlite] Does anybody have a working version of php_sqlite3.dll?

2009-03-04 Thread ZeWaren / Erwan Martin
Hello everyone. I hope I'm not violating any disclaimer posting this message. A few days ago I had to migrate my project from linux to windows. It is using the php sqlite3 extension, to access sqlite3 database files. Problem is, I can't find the extension dll (php_sqlite3.dll). I found one on a