[sqlite] Race condition -- fixed?

2007-10-24 Thread Richard Klein
As I was thinking about the locking mechanism in SQLite 3, it occurred to me that the following race condition could occur. Imagine a joint bank account with a balance of $10,000. The wife makes a withdrawal of $1,000 at ATM 'A' (serviced by process A in the bank's mainframe), while at the same

Re: [sqlite] How to implement xLock()?

2007-10-24 Thread Richard Klein
John Stanton wrote: Are you certain that you need to run a full suite of tests on Sqlite to verify that your compatibility layer is correct? How about developing a test suite for your porting layer If it works identically on each platform you can have confidence that your overlaid software

Re: [sqlite] Lemon not reducing

2007-10-24 Thread Grzegorz Makarewicz
Gaspard Bucher wrote: > PS: There is another reason, aside from aesthetics and simpler grammar > to filter white spaces inside the tokenizer: you avoid all the parser > conflicts you could get with "empty | or space" rules. > > 2007/10/24, Gaspard Bucher <[EMAIL PROTECTED]>: > >>> Gaspard

Re: [sqlite] LIKE operator syntax for white space

2007-10-24 Thread Yuriy Martsynovskyy
These only strip lines with Space characters. I need also to filter out also tabs, carriage returns and all series characters that constitute a white space. - To unsubscribe, send email to [EMAIL PROTECTED]

RE: [sqlite] Re: Some Questions Regarding Access To a SQLite Database By More Than One Process

2007-10-24 Thread Lee Crain
Ken, Igor, I read the article you referenced. Much appreciated. http://sqlite.org/lockingv3.html I didn't want to complicate my original questions with the intricate details of the application requirements which involve not allowing any database access while certain other operations are

Re: [sqlite] Lemon not reducing

2007-10-24 Thread Gaspard Bucher
PS: There is another reason, aside from aesthetics and simpler grammar to filter white spaces inside the tokenizer: you avoid all the parser conflicts you could get with "empty | or space" rules. 2007/10/24, Gaspard Bucher <[EMAIL PROTECTED]>: > > Gaspard Bucher <[EMAIL PROTECTED]> wrote: > > > I

Re: [sqlite] Lemon not reducing

2007-10-24 Thread Gaspard Bucher
> Gaspard Bucher <[EMAIL PROTECTED]> wrote: > > I do not understand why lemon waits for one more token when it has > > enough information to reduce. > > > > I want to recognize : > > foo = Bar() > > when the token CLOSE_PAR is received, not when an extra token is parsed.. > > > > How can I avoid

[sqlite] Re: Re: Some Questions Regarding Access To a SQLite Database By More Than One Process

2007-10-24 Thread Igor Tandetnik
Lee Crain <[EMAIL PROTECTED]> wrote: Igor, I did say "controlled" concurrency. I'll rephrase question 3. 3) Would use of a MUTEX to avoid the dreaded "SQLite busy" condition be a good solution? Wouldn't it prevent multiple concurrent readers? That's usually something you want. Or is

RE: [sqlite] Re: Some Questions Regarding Access To a SQLite Database By More Than One Process

2007-10-24 Thread Lee Crain
Igor, I did say "controlled" concurrency. I'll rephrase question 3. 3) Would use of a MUTEX to avoid the dreaded "SQLite busy" condition be a good solution? Or is some other method of avoiding a busy condition recommended? Lee Crain __ -Original Message- From: Igor

Re: [sqlite] Some Questions Regarding Access To a SQLite Database By More Than One Process

2007-10-24 Thread Ken
Lee, 1. Qualified Yes, depending on your definition of concurrency. 2. Connections may remain open. 3. Mutexes are not required for protection. Read the following: http://sqlite.org/lockingv3.html Lee Crain <[EMAIL PROTECTED]> wrote: I loosely follow this forum so I am almost certain this

[sqlite] Re: Some Questions Regarding Access To a SQLite Database By More Than One Process

2007-10-24 Thread Igor Tandetnik
Lee Crain <[EMAIL PROTECTED]> wrote: 1. Can multiple processes "concurrently" access the same SQLite database? Yes. 2. If so, can multiple processes maintain an open connection to the database? Or must the connection be opened and closed, before and after, respectively, each database access?

[sqlite] Some Questions Regarding Access To a SQLite Database By More Than One Process

2007-10-24 Thread Lee Crain
I loosely follow this forum so I am almost certain this subject has come up in the forum in the last few months. However, until Monday of this week, this subject had not come up in my company's application requirements so I made few mental notes on it. Now, a requirement for having 2 or more

[sqlite] primary key constraint

2007-10-24 Thread David Nguyen
Hello, With php, I want to create 2 tables, userid is a primary key in TUser and a foreign key in TRight. I want to create a default user during database creation. $sql1 = 'CREATE TABLE TUser(userid UNSIGNED INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username TEXT, pseudo TEXT, password TEXT,

Re: [sqlite] Lemon not reducing

2007-10-24 Thread drh
Gaspard Bucher <[EMAIL PROTECTED]> wrote: > I do not understand why lemon waits for one more token when it has > enough information to reduce. > > I want to recognize : > foo = Bar() > when the token CLOSE_PAR is received, not when an extra token is parsed. > > How can I avoid lemon waiting for

[sqlite] Lemon not reducing

2007-10-24 Thread Gaspard Bucher
I do not understand why lemon waits for one more token when it has enough information to reduce. I want to recognize : foo = Bar() when the token CLOSE_PAR is received, not when an extra token is parsed. How can I avoid lemon waiting for the extra token before reducing ? Thanks for your help !

Re: [sqlite] PATCH: compound (multi-row) INSERT statements

2007-10-24 Thread Ken
I see now, thanks for the clarification. Sorry for the ramblings. And there is a .mode csv so that should take care of data loading. Regards, Ken Joe Wilson <[EMAIL PROTECTED]> wrote: --- Ken wrote: >A new command ".imp" command could be made to use my proposed array based > processing.

RE: [sqlite] Help with an unusual query

2007-10-24 Thread Samuel R. Neff
This can be done with a custom aggregate function. I posted an example a week or so ago here in the list (example in C#). SELECT key, DisplayList(data) GROUP BY Key where DisplayList() is a custom function that concatenates it's values. I don't think this can be done in straight SQL. HTH,

[sqlite] Help with an unusual query

2007-10-24 Thread Rich Rattanni
All: I have the following table key data 1 'Version 1' 1 'Version 2' 1 'Version 3' 2 'Version 4' 2 'Version 5' (obviously key is not primary) I want to write a query that returns key data 1 'Version 1 Version 2 Version 3' 2

Re: [sqlite] Changing journal-directory?

2007-10-24 Thread drh
Thomas Damme <[EMAIL PROTECTED]> wrote: > Hello, > > this question was propably asked a hundred times before but I was not > able to find a good answer for it on the web. > > Is it possible to change the directory where SQLite places the > journal-file? We have a damn-slow USB-Stick where the

[sqlite] Changing journal-directory?

2007-10-24 Thread Thomas Damme
Hello, this question was propably asked a hundred times before but I was not able to find a good answer for it on the web. Is it possible to change the directory where SQLite places the journal-file? We have a damn-slow USB-Stick where the database resides. It does not fit into the fast internal

Re: [sqlite] syntax error

2007-10-24 Thread Markus Hoenicka
Quoting nishit sharma <[EMAIL PROTECTED]>: Hi All, Sending y peoples same query with some explanation. i have a database name myds.db which is having one column as index (integer default 0) which has no values in complete database. when i used to access somthing with reference to index in

[sqlite] syntax error

2007-10-24 Thread nishit sharma
Hi All, Sending y peoples same query with some explanation. i have a database name myds.db which is having one column as index (integer default 0) which has no values in complete database. when i used to access somthing with reference to index in command than i get the error SQL error: near

[sqlite] Re: Vista-IE7 problem

2007-10-24 Thread Barabbas [EMAIL PROTECTED]
Barabbas Jiang Gmail <[EMAIL PROTECTED]> writes: > > Hi all, > > I found another strange problem of SQLite on Vista with IE7. > I have an input method with SQLite. When I opened it in IE7 for > typing Chinese, the SQLite returned nothing. However, *if IE7 is > "run as administrator," SQLite

Re: [sqlite] Documentation - Downloadable?

2007-10-24 Thread Dan Kennedy
On Tue, 2007-10-23 at 19:54 -0500, Andrew Wiley wrote: > I've been using SQLite on several minor projects now (it makes File IO so > easy), and the one suggestion I would make would be to make the > documentation (api reference) downloadable. > It would be very handy for myself and probably many

[sqlite] syntax error

2007-10-24 Thread nishit sharma
Hi All, i have a database in which there is a column named index (integer value). when i m doing select index and all other stuff i m continuosly getting an error that is: SQL error: near "index": syntax error and this error doesn't come if i remove index entry from my command can anybody tell me

Re: [sqlite] trigger a non-database event in sqlite

2007-10-24 Thread Dan Kennedy
On Tue, 2007-10-23 at 19:33 -0700, d_maniger06 wrote: > ok..i have this sample code: > > [code] > void printIfInsert() > { > printf( "Insertion was done in t1\n" ); > } > > void createTrigger( sqlite** db, sqlite_vm** pvm ) > { > char* errMsg; > const char** psql = NULL; > const

Re: [sqlite] what extension do you recommend

2007-10-24 Thread Ramon Ribó
You should consider the extension for, at least, three situations: - Anti virus can check files differently depending on the extension - Backup programs can also react on this - Windows takes it into account when indexing files Compass Ing. y Sistemas Dr. Ramon Ribo

Re: [sqlite] Documentation - Downloadable?

2007-10-24 Thread Olaf Beckman Lapré
Aren't there any source documents? I assume the documentation wasn't written in HTML originally. Olaf - Original Message - From: "John Stanton" <[EMAIL PROTECTED]> To: Sent: Wednesday, October 24, 2007 07:50 Subject: Re: [sqlite] Documentation -