Re: [sqlite] Column alignment in bash with utf8

2006-01-02 Thread Matt Wilson
7;t extremely portable. Therefore, I wouldn't recommend applying it without adding some autoconf-style detection and stub out wstrlen() for platforms that don't have the needed functions. Cheers, Matt -- Matt Wilson rPath, Inc. [EMA

Re: [sqlite] bug in SELECT DISTINCT ?

2005-09-17 Thread Matt Wilson
M t1, map WHERE t1.id = map.idT1 GROUP BY id; 1|1|1|dd|1|2 2|2|1|dd|2|2 3|3|1|dd|3|2 Not sure if this is really what you want, because you're losing data from the map as rows are excluded. -- Matt Wilson rpath, Inc. [EMAIL PROTECTED]

Re: [sqlite] SQLITE_BUSY returned without busy handler called

2004-10-19 Thread Matt Wilson
On Tue, Oct 19, 2004 at 11:58:48AM -0700, Kevin Schmeichel wrote: > > Really, what I was concerned about was getting > SQLITE_BUSY from sqlite_finalize - if I try and call > sqlite_finalize again, I get SQLITE_MISUSE. I haven't > gone through the code in enough detail to determine > what the ef

Re: [sqlite] Version 3.0.8

2004-10-14 Thread Matt Wilson
On Thu, Oct 14, 2004 at 01:33:01PM +0200, Jakub Adamek wrote: > Does this version support the verious BEGIN TRANSACTION types? >From the web site: Version 3.0.8 of SQLite contains several code optimizations and minor bug fixes and adds support for DEFERRED, IMMEDIATE, and EXCLUSIVE trans

Re: [sqlite] Improving Performance of INSERT INTO?

2004-09-15 Thread Matt Wilson
On Wed, Sep 15, 2004 at 02:14:58PM -0700, Roger Dant wrote: > > Here's the slow code: > > sqlite3* db; > CString sql; > sqlite3_open("c:\\test.db", &db); > sqlite3_exec(db, "PRAGMA SYNCHRONOUS", NULL, NULL, NULL); > sqlite3_exec(db, "CREATE TABLE X (I LONG, J LONG)", NULL, NULL, NULL); > for (i

[sqlite] invalid btree cursor read locks honored?

2004-09-15 Thread Matt Wilson
I'm having problems with code that starts a transaction, creates a table, commits, begins a new transaction, creates a temporary table, inserts data into the temporary table, and the inserts into the table the results of a select from the temporary table. The insert statement results in a SQLITE_E

Re: [sqlite] SQLite on 64-bit unix

2004-09-08 Thread Matt Wilson
On Wed, Sep 08, 2004 at 04:13:57PM -0400, D. Richard Hipp wrote: > > Please try the latest code in CVS and see if it helps. Tnx. Works with the attached patch. Oh, forgot to mention that printf tests fail: Failures on these tests: printf-1.10.1 printf-1.10.2 printf-1.10.3 printf-1.10.4 printf-

Re: [sqlite] SQLite on 64-bit unix

2004-09-08 Thread Matt Wilson
On Wed, Sep 08, 2004 at 11:53:30AM -0400, Matt Wilson wrote: > > That's not the solution. Your btree cursor (and other pointers) are > being truncated: Here's a patch to correct this. There are also some cosmetic changes to reduce warnings on 64 bit platforms. The p

Re: [sqlite] SQLite on 64-bit unix

2004-09-08 Thread Matt Wilson
On Wed, Sep 08, 2004 at 11:10:35AM -0400, D. Richard Hipp wrote: > > Please try again with the lastest version under CVS and see if it helps. > Check-in [1948] will have fixed this problem if I am not badly mistaken. That's not the solution. Your btree cursor (and other pointers) are being trunc

Re: [sqlite] sqlite3_busy_timeout() not working with 3.0.x?

2004-09-03 Thread Matt Wilson
On Fri, Sep 03, 2004 at 09:20:05AM -0400, D. Richard Hipp wrote: > > It does if you put the timeout on pDb2. You're right. That's what I get for hacking up test cases at 1 AM. Thanks, Matt

Re: [sqlite] sqlite3_busy_timeout() not working with 3.0.x?

2004-09-02 Thread Matt Wilson
On Thu, Sep 02, 2004 at 08:24:21PM -0400, D. Richard Hipp wrote: > > If you do separate sqlite3_open() calls for each statement, > the behavior will be more along the lines of what you expect. Attached test case still doesn't seem to wait. $ ./testcase elapsed seconds 0 rc is 5 error database is

[sqlite] sqlite3_busy_timeout() not working with 3.0.x?

2004-09-02 Thread Matt Wilson
I have two statements in one process statement 1statement 2 ------ prepare("select * from foo") step() == SQLITE_ROW prepare("insert into foo values(1)" step() == S

Re: [sqlite] Locking in 3.0.5

2004-09-01 Thread Matt Wilson
On Wed, Sep 01, 2004 at 02:46:39PM +0100, Christian Smith wrote: > > Add a new "BEGIN [TRANSACTION] FOR READONLY" statement, which begins the > transaction with a read lock only and doesn't allow the transaction to > even try to promote to a write lock. Why do you need a transaction at all if you

Re: [sqlite] host parameters / bind variables - further workouts

2004-08-25 Thread Matt Wilson
On Wed, Aug 25, 2004 at 09:46:38PM -0700, Darren Duncan wrote: > > While I see this issue now closed, following Richard's explanation of > how things actually are working now, I'm curious as to where in the > SQL:2003 standard it mentions positional host parameters and '?'; > please give a refe

Re: [sqlite] host parameters / bind variables - further workouts

2004-08-25 Thread Matt Wilson
On Wed, Aug 25, 2004 at 06:22:26PM -0700, Darren Duncan wrote: > > For "backwards compatability", any plain '?' could still be allowed, > and be mixed with both other usages, and each '?' occurance would > implicitly be the same as ?1, ?2, etc. Not only backwards compatibility, but standards com

Re: [sqlite] Python bindings for sqlite 3

2004-08-25 Thread Matt Wilson
On Wed, Aug 25, 2004 at 12:27:28AM -0700, David M. Cook wrote: > > Yeah, it's read-only, though, (no __setitem__), you have to "cast" to a dict > if you want to use the rows in your app. Hmmm. Anything beyond providing the sequence protocol for the result of a fetchone() is an extension anyway..

Re: [sqlite] Python bindings for sqlite 3

2004-08-24 Thread Matt Wilson
On Tue, Aug 24, 2004 at 08:43:47PM -0700, David M. Cook wrote: > > * DBAPI compliance is important to me. sqlite is only one of the DBs I'd > like to support in my apps. Do you know what's currently lacking in conformance? > * I use pyformat pretty heavily. I like being able to use dictionar

Re: [sqlite] bind variables

2004-08-24 Thread Matt Wilson
On Tue, Aug 24, 2004 at 07:10:55PM -0700, Darren Duncan wrote: > > Meanwhile, look here: http://www.wiscorp.com/SQLStandards.html ISO/IEC 9075-2:2003 (E) (DRAFT) 5.4 Names and identifiers ::= Also see 4.29 "Host parameters" all in 5WD-02-Foundation-2003-09.pdf Cheers, Matt

[sqlite] Re: [Pysqlite-devel] Re: [sqlite] Python bindings for sqlite 3

2004-08-24 Thread Matt Wilson
On Tue, Aug 24, 2004 at 03:37:15PM -0400, D. Richard Hipp wrote: > > > >d = { 'blob': 'a\0b', 'id': 2 } > >cursor.execute("UPDATE t1 SET value=%(bigblob)s WHERE rowid=%(id)d", d) > > > > I'd be willing to extend the lexer/parser of SQLite to accept this kind > of thing. The only problem here is t

Re: [sqlite] bind variables

2004-08-24 Thread Matt Wilson
On Tue, Aug 24, 2004 at 03:15:30PM -0400, Andrew Piskorski wrote: > > Btw, I've used these database APIs and know that they all use ':' to > indicate a named bind variable which then maps to a Tcl variable, in > very much the same scheme you've explained above: Using : to name the variable would

[sqlite] Re: [Pysqlite-devel] Re: [sqlite] Python bindings for sqlite 3

2004-08-24 Thread Matt Wilson
On Tue, Aug 24, 2004 at 02:55:51PM -0400, D. Richard Hipp wrote: > > I do not know if this new technique will be helpful to Python > or not, but I thought I would bring it to your attention, just > in case it is. Please note that the changes to support this > are in CVS but have not be added to a

[sqlite] Python bindings for sqlite 3

2004-08-24 Thread Matt Wilson
Hi. I've been working on some refactoring of the Python bindings for sqlite. I now have a working Python binding for sqlite 3 which is fairly different than the bindings for sqlite 2. I created a quick test case that creates a new table, inserts 500,000 rows, then selects all of them. Memory ut

Re: [sqlite] Problems with the C interface

2004-08-24 Thread Matt Wilson
On Tue, Aug 24, 2004 at 06:58:32PM +0200, Holger Brunck wrote: > > In my case I skip the sqlite_step() command, but I assume that the > sqlite_compile() command is the important one. You have to call sqlite_step(), or the database engine never does anything. Cheers, Matt