[sqlite] is sqlite3_open an expensive operation?

2005-10-03 Thread jack wu
do we usually do: open db->some operation with db->close db. or keep the db handle with the thread and use it all the time? i am asking this mainly because of possible error conditions. when an error happens, is it better to close the database and reopen it later? i am going to lock the handle

Re: [sqlite] Newbie coherency questions ... poor man's replication? Proper replication approaches?

2005-10-03 Thread Dan Kennedy
> We're building a multi-master, peer-to-peer network service, > so we need a way to replicate changes between systems. Unsolicited advice: Of course I don't understand your problem domain, but I'm a big fan of a technology called "virtual synchrony" for this kind of thing. Very successful whe

[sqlite] Re: Sqlite & NFS

2005-10-03 Thread gammal . sqlite
What matters for me the most actually is how sqlite will behave in a non-concurrent scenario in case NFS fails (the NFS mount is suddenly unavailable for example). Can I still assume that the ACID properties are maintained? [EMAIL PROTECTED] writes: > [EMAIL PROTECTED] wrote: >> Hello, >> I'm

[sqlite] Newbie coherency questions ... poor man's replication? Proper replication approaches?

2005-10-03 Thread Bryan J. Smith
I've heard about this project for so many years, but I don't know why I ignored it until now. I was just reading the FAQ on coherency and threading: http://www.sqlite.org/faq.html#q7 I believe this is outstanding for an embedded DB engine, something I've never seen in anything else. If I a

Re: [sqlite] ANN: Sqlite3Explorer version 2.0 released

2005-10-03 Thread G. Roderick Singleton
On Mon, 2005-10-03 at 19:52 +0300, Cariotoglou Mike wrote: > this is a major release, with a lot of changes. please see the readme at > www.singular.gr/sqlite. > Pls read the whole page carefully, as support for datatypes is now a lot > more powerful, but slightly different than > the previous vers

Re: [sqlite] ANN: Sqlite3Explorer version 2.0 released

2005-10-03 Thread Bert Verhees
Mike, a very good, stable and handy tool. Especially I have a lot of pleasure with the querybuilder, saves me a lot of time. Thank you very much, Regards Bert Verhees. Op maandag 3 oktober 2005 18:52, schreef Cariotoglou Mike: > this is a major release, with a lot of changes. please see the re

RE: [sqlite] ANN: Sqlite3Explorer version 2.0 released

2005-10-03 Thread Cariotoglou Mike
Yes, this is an issue with a number of menu selections, which I forgot to fix :) will do on the next release. For now, just open a db first.. > -Original Message- > From: Dennis Cote [mailto:[EMAIL PROTECTED] > Sent: Monday, October 03, 2005 8:57 PM > To: sqlite-users@sqlite.org > Subjec

Re: [sqlite] Rewriting a query

2005-10-03 Thread John LeSueur
[EMAIL PROTECTED] wrote: Robin Breathe <[EMAIL PROTECTED]> wrote: Hugh Gibson wrote: I'm intrigued. How do you get SQLite to use a multi-column index as it's primary key (i.e. B-tree hash)? Please elaborate. Simply CREATE TABLE TransactionList (sTransactionID Text(13) DEFAUL

Re: RE: [sqlite] Bitwise comparison -- consider not getting bit

2005-10-03 Thread debra f
Thx for the opinion. Will consider it! On Mon, 3 Oct 2005, Griggs, Donald ([EMAIL PROTECTED]) wrote: > Regarding: > "...What's the best way to do a bitwise comparison in a sql query...?" > > Hi Debra, > > Dennis Cote gave you a direct answer to your question -- since sqlite > suppo

Re: [sqlite] Rewrite of where.c without DOUBLE Values

2005-10-03 Thread John LeSueur
Sankara Narayanan wrote: Dear Hipp and all, We request you to provide guidelines for the implementation of where.c without using any of the DOUBLE values. We need to find the bestIndex calculation with all integer variables and integer values. We converted all doubles to integers by typecast

Re: [sqlite] ANN: Sqlite3Explorer version 2.0 released

2005-10-03 Thread Dennis Cote
Cariotoglou Mike wrote: this is a major release, with a lot of changes. please see the readme at www.singular.gr/sqlite. Pls read the whole page carefully, as support for datatypes is now a lot more powerful, but slightly different than the previous versions. Report users : you will need to down

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-10-03 Thread René Tegel
Hi, May i add to that that 'order by' also seems involved, see below. This can lead to really unexpected errors... "order by 1.0 * b / c" as workaround solves it btw. Differating between floating point operator '/' and integer operator 'DIV' like some program languages do would lead to predict

RE: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-10-03 Thread Jackson, Douglas H
Perhaps not a solution, but a workaround: Try coercing the data entering the table into a value recognizable as a real: Create trigger t_t1i after insert on t1 Begin Update t1 set a = 1.0 * a, b = 1.0 * b Where rowid = new.rowid; End; Create trigger t_t1u after update on t1 Begin Update t1

RE: [sqlite] Bitwise comparison -- consider not getting bit

2005-10-03 Thread Griggs, Donald
Regarding: "...What's the best way to do a bitwise comparison in a sql query...?" Hi Debra, Dennis Cote gave you a direct answer to your question -- since sqlite supports bit operations directly in SQL. But I wondered if you might want to evaluate dispensing with bit-wise variables and usin

Re: [sqlite] Importing NOT Working (pls)

2005-10-03 Thread Puneet Kishor
On Oct 3, 2005, at 11:44 AM, Richard wrote: Well, Did this: sqlite3 test2.db create Table T (A, B, C ); .separator , .import 'sqtest2.txt' T It looks like it working, but the file size is still 4K and not 170 Megs. Please note: I exported this database as a Tab delimiter file, then as a Com

Re: [sqlite] Rewrite of where.c without DOUBLE Values

2005-10-03 Thread Dennis Cote
Sankara Narayanan wrote: Dear Hipp and all, We request you to provide guidelines for the implementation of where.c without using any of the DOUBLE values. We need to find the bestIndex calculation with all integer variables and integer values. We converted all doubles to integers by typecast

[sqlite] ANN: Sqlite3Explorer version 2.0 released

2005-10-03 Thread Cariotoglou Mike
this is a major release, with a lot of changes. please see the readme at www.singular.gr/sqlite. Pls read the whole page carefully, as support for datatypes is now a lot more powerful, but slightly different than the previous versions. Report users : you will need to download an extra dll, it is bo

Re: [sqlite] Problem/Bug: "SELECT 5 / 2;" returns 2 ?

2005-10-03 Thread Ralf Junker
Hello DRH, >> 3. If the division of INTEGERs can not be stored as an INTEGER >>(i.e. if a % b != 0), the result should be returned as a REAL. >> > >create table t1( a integer, b integer); >insert into t1 values(5,2); >update t1 set a=a/b; > >If your rule above was in force, this would leave >T1.

[sqlite] Importing NOT Working (pls)

2005-10-03 Thread Richard
Well, Did this: sqlite3 test2.db create Table T (A, B, C ); .separator , .import 'sqtest2.txt' T It looks like it working, but the file size is still 4K and not 170 Megs. Please note: I exported this database as a Tab delimiter file, then as a Comma, delimiter file... ** Got it to import, how

Re: [sqlite] Bitwise comparison

2005-10-03 Thread Dennis Cote
debra f wrote: What's the best way to do a bitwise comparison in a sql query such as the one indicated below - for example - i have one Indicator field (currently defined as numeric) in my table which is being used to store a variety of indicators (rather than having a slew of boolean columns)

Re: [sqlite] Bitwise comparison

2005-10-03 Thread Martin Engelschalk
Hello Debra, as far as i know, SQL standard does not have an operator or function that does bitwise comparison, and sqlite surely does not. However, you can add a function using sqlite3_create_function (See http://www.sqlite.org/capi3ref.html#sqlite3_create_function) that does this, and then u

[sqlite] Rewrite of where.c without DOUBLE Values

2005-10-03 Thread Sankara Narayanan
Dear Hipp and all, We request you to provide guidelines for the implementation of where.c without using any of the DOUBLE values. We need to find the bestIndex calculation with all integer variables and integer values. We converted all doubles to integers by typecasting (we use #define as doubl

[sqlite] Bitwise comparison

2005-10-03 Thread debra f
What's the best way to do a bitwise comparison in a sql query such as the one indicated below - for example - i have one Indicator field (currently defined as numeric) in my table which is being used to store a variety of indicators (rather than having a slew of boolean columns) eg (random example

Re: [sqlite] Sqlite & NFS

2005-10-03 Thread drh
[EMAIL PROTECTED] wrote: > Hello, > I'm considering using sqlite in a system where the database might be > accessed concurrently from several machines over NFS. I'm aware of > locking issues & NFS but I have a couple of questions: > > - Could an NFS-level failure cause data inconsistency, or can

Re: RE: [sqlite] SQLite kind-of memory leak (PATCH) - bug reports

2005-10-03 Thread drh
Clifford Wolf <[EMAIL PROTECTED]> wrote: > Hi, > > On Mon, Oct 03, 2005 at 09:02:38AM -0400, [EMAIL PROTECTED] wrote: > > You are right: this is not a real memory leak. > > [..] > > in fact, for a program which is eg. continously using mktemp() (or a > simmilar but not unsecure api) for creating

RE: RE: [sqlite] SQLite kind-of memory leak (PATCH) - bug reports

2005-10-03 Thread Thomas Briggs
While I can understand your general sentiment, allowing minor problems like this to clutter the output from valgrind makes spotting the real errors amidst the noise more difficult. Eventually, when enough of these types of problems exist, valgrind stops being used altogether, because it's too

Re: [sqlite] Speed Test not work (pt2)

2005-10-03 Thread Dennis Cote
Richard Nagle wrote: Well, Did this: sqlite3 test2.db create Table T (A, B, C ); .separator , .import 'sqtest2.txt' T It looks like it working, but the file size is still 4K and not 170 Megs. Please note: I exported this database as a Tab delimiter file, then as a Comma, delimite

Re: [sqlite] Redirecting stderr to a file

2005-10-03 Thread Jay Sprenkle
cat yourfile 2>somenewfile.txt On 10/3/05, Downey, Shawn <[EMAIL PROTECTED]> wrote: > > When working from the command line I can redirect the stdout to a file > with the command .output. Is there a similar way to redirect stderr to > a file? Thanks you. > > > > Shawn M. Downey > > MPR Associates

[sqlite] Redirecting stderr to a file

2005-10-03 Thread Downey, Shawn
When working from the command line I can redirect the stdout to a file with the command .output. Is there a similar way to redirect stderr to a file? Thanks you. Shawn M. Downey MPR Associates 10 Maxwell Drive, Suite 204 Clifton Park, NY 12065 518-371-3983 x3 (work) 860-508-5015 (cell)

Re: [sqlite] SQLite kind-of memory leak (PATCH) - bug reports

2005-10-03 Thread drh
Clifford Wolf <[EMAIL PROTECTED]> wrote: > > > but instead start a ticket at: > > http://www.sqlite.org/cvstrac/tktnew > > what shall I do with the patch? simply copy&paste it to the 'bug description' > text field? i haven't seen a file upload function in the interface. > There is an "[attach]"

Re: RE: [sqlite] SQLite kind-of memory leak (PATCH) - bug reports

2005-10-03 Thread Clifford Wolf
Hi, On Mon, Oct 03, 2005 at 09:02:38AM -0400, [EMAIL PROTECTED] wrote: > You are right: this is not a real memory leak. > [..] in fact, for a program which is eg. continously using mktemp() (or a simmilar but not unsecure api) for creating temporary databases it is a real memory leak, because the

Re: [sqlite] SQLite kind-of memory leak (PATCH) - bug reports

2005-10-03 Thread Clifford Wolf
Hi, thanks for the quick reply, On Mon, Oct 03, 2005 at 08:35:10AM -0400, Griggs, Donald wrote: > Page http://www.sqlite.org/support.html Suggests that you *not* directly > email the (actually pretty responsive) author, the page says: Please do not send email directly to the author of S

[sqlite] Sqlite & NFS

2005-10-03 Thread gammal . sqlite
Hello, I'm considering using sqlite in a system where the database might be accessed concurrently from several machines over NFS. I'm aware of locking issues & NFS but I have a couple of questions: - Could an NFS-level failure cause data inconsistency, or can sqlite handle such errors? - I'm us

Re: RE: [sqlite] SQLite kind-of memory leak (PATCH) - bug reports

2005-10-03 Thread drh
"Griggs, Donald" <[EMAIL PROTECTED]> wrote: > > > > I'm using valgrind for checking for memory leaks in SPL. When > > profiling scripts which do access SQLite databases, I've found that > > the lockHash and openHash data structures in os_unix.c don't get freed. > > > > I wouldn't consider that

RE: [sqlite] SQLite kind-of memory leak (PATCH) - bug reports

2005-10-03 Thread Griggs, Donald
Hi Clifford, Page http://www.sqlite.org/support.html Suggests that you *not* directly email the (actually pretty responsive) author, but instead start a ticket at: http://www.sqlite.org/cvstrac/tktnew Donald Griggs Opinions are not necessarily those of Misys Healthcare Systems nor its board

RE: [sqlite] How to speed up SQLite

2005-10-03 Thread Thomas Briggs
Given my understanding of the codebase (you get to decide what that's worth), the value of the synchronous pragma determines decisions going forward, so changing it mid-process should impact only transaction handling from that point forward. I do know, however, that there are places in the cod

[sqlite] SQLite kind-of memory leak (PATCH)

2005-10-03 Thread Clifford Wolf
Hi, I have sent the following mail to [EMAIL PROTECTED] about a month ago. But I got no reply and as far as I can see my patch has not been applied in the sqlite cvs so far. If [EMAIL PROTECTED] is the wrong address to send sqlite development issues, what is the right one? I can only find a point