[sqlite] [PATCH] Fix --enable-threadsafe for version 3.2.3

2005-08-22 Thread Glen Nakamura
Aloha, The -DTHREADSAFE=1 option is added to the OPTS variable, but is not used when compiling the source files. I think the option needs to be added to the TCC variable instead... - glen diff -Nru3p sqlite-3.2.3.orig/Makefile.in sqlite-3.2.3/Makefile.in --- sqlite-3.2.3.orig/Makefile.in

[sqlite] Running a select on multiple servers.

2005-08-22 Thread Ligesh
Hi, Currently sqlite code reads the data from the disk, sorts them and returns the data. I need to do the following, and would like to know how much work will it involve. Instead of reading from disk, I need to query say 100 servers simultaneously in parallel (using threads) a single

[sqlite] Sqlite 3.2.3 use of Tcl_WideInt not defined in Tcl/Tk 8.3.5

2005-08-22 Thread Downey, Shawn
I am building an sqlite3 library as part of a project. I just tried upgrading Sqlite version 3.0.8 to version 3.2.3. We use Tcl/Tk 8.3.5 and are sort of stuck with it. The new tclsqlite.c declares Tcl_WideInt which is not defined in the include files for Tcl/Tk 8.3.5. Can someone

[sqlite] Can you use random(*) to retrieve a pseudo random row from 3.2.3?

2005-08-22 Thread Brandon, Nicholas
Hi, I trying to see if I can use the random(*) function to select a pseudo-random row and not sure if it will work as I expect. I want to use it to select a row based on two column values, however I suspect that each time random(*) is called in a single SQL line, it retrieves a different

Re: [sqlite] Sqlite 3.2.3 use of Tcl_WideInt not defined in Tcl/Tk 8.3.5

2005-08-22 Thread D. Richard Hipp
On Mon, 2005-08-22 at 10:51 -0400, Downey, Shawn wrote: > We use Tcl/Tk 8.3.5 and are sort of stuck with it. The new tclsqlite.c > declares Tcl_WideInt which is not defined in the include files for > Tcl/Tk 8.3.5. > Tclsqlite.c requires Tcl 8.4 or later. You can try to back port it if you

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Clark Christensen
--- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote: > ... > SQLite never "blows away" a file that is not a database. > > -- > D. Richard Hipp <[EMAIL PROTECTED]> Sorry to report this doesn't seem to be the case. At least not under Windows. Using v3.2.2, I can "sqlite3 junk.txt", then "create

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread D. Richard Hipp
On Mon, 2005-08-22 at 08:42 -0700, Clark Christensen wrote: > > --- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote: > > ... > > SQLite never "blows away" a file that is not a database. > > > > -- > > D. Richard Hipp <[EMAIL PROTECTED]> > > Sorry to report this doesn't seem to be the case. At

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Clark Christensen
--- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote: > On Mon, 2005-08-22 at 08:42 -0700, Clark Christensen > wrote: > > > > --- "D. Richard Hipp" <[EMAIL PROTECTED]> wrote: > > > ... > > > SQLite never "blows away" a file that is not a > database. > > > > > > -- > > > D. Richard Hipp <[EMAIL

RE: [sqlite] Sqlite 3.2.3 use of Tcl_WideInt not defined in Tcl/Tk8.3.5

2005-08-22 Thread Downey, Shawn
I emailed Dr. Hipp separately on this issue. Thanks. I may try to upgrade Tcl to 8.4. But this patch looks like it may work as well (for my purposes only). I inserted the following in tclsqlite.c just after the #includes: /* Added to support backward compatibility to Tcl/Tk 8.3 */ #include

RE: [sqlite] Sqlite 3.2.3 use of Tcl_WideInt not defined in Tcl/Tk8.3.5

2005-08-22 Thread D. Richard Hipp
On Mon, 2005-08-22 at 12:15 -0400, Downey, Shawn wrote: > But this patch looks like it may work as well (for my purposes only). I > inserted the following in tclsqlite.c just after the #includes: > > /* Added to support backward compatibility to Tcl/Tk 8.3 */ > #include "os.h" > #if OS_WIN

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Edwin Knoppert
Confirmed but open still opens the textfile, i wish it cancelled that as well. There is no use to an open textfile for sqlite. - Original Message - From: "D. Richard Hipp" <[EMAIL PROTECTED]> To: Sent: Monday, August 22, 2005 5:54 PM Subject: Re: [sqlite]

RE: [sqlite] Sqlite 3.2.3 use of Tcl_WideInt not defined inTcl/Tk8.3.5

2005-08-22 Thread Downey, Shawn
>> But this patch looks like it may work as well (for my purposes only). I >> inserted the following in tclsqlite.c just after the #includes: >> >> /* Added to support backward compatibility to Tcl/Tk 8.3 */ >> #include "os.h" >> #if OS_WIN /* This file is used for windows only

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Mark de Vries
On Mon, 22 Aug 2005, Edwin Knoppert wrote: > Confirmed but open still opens the textfile, i wish it cancelled that as > well. > There is no use to an open textfile for sqlite. > I must say I agree. Perhaps there is some verry good reason to delay actually opening the DB untill the first real

Re: [sqlite] Possible bug regarding endiannes and realstorageclass (sqlite3)

2005-08-22 Thread Frank van Vugt
L.S. In order to wrap this up: apparently there's a feature / bug (choose one) in any ARM core earlier than v5 due to which a float will be stored in big endian quad order. The processor in this particular case is an SA1110, which is default little endian while having a v4 core. (and thus

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Edwin Knoppert
Hmm, but every known file format has an header. Sqlite has a string, not really a header as it seems. Maybe for v4 to implement a real header (if not yet) A header doesn't need to be encrypted. (A bit for testing if it's encrypted might have it use as well) Sqlite seems to be created espec. for

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Edwin Knoppert
Hmm, the latter might have sounded a bit harsh. It must be seen as reminder, no pointing finger or so :) - Original Message - From: "Edwin Knoppert" <[EMAIL PROTECTED]> To: Sent: Monday, August 22, 2005 11:12 PM Subject: Re: [sqlite] Why can i open a

[sqlite] Encryption and fixed header values (was Re: [sqlite] Why can i open a textfile?)

2005-08-22 Thread Mike Shaver
On 8/22/05, Edwin Knoppert <[EMAIL PROTECTED]> wrote: > Hmm, but every known file format has an header. > Sqlite has a string, not really a header as it seems. > Maybe for v4 to implement a real header (if not yet) > A header doesn't need to be encrypted. > (A bit for testing if it's encrypted

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Dennis Jenkins
Edwin Knoppert wrote: Hmm, but every known file format has an header. Sqlite has a string, not really a header as it seems. Sqlite has a header. Part of it is plain text, part binary. You can learn about it by reading the source code. Maybe for v4 to implement a real header (if not

Re: [sqlite] Encryption and fixed header values (was Re: [sqlite] Why can i open a textfile?)

2005-08-22 Thread Dennis Jenkins
Mike Shaver wrote: On 8/22/05, Edwin Knoppert <[EMAIL PROTECTED]> wrote: Hmm, but every known file format has an header. Sqlite has a string, not really a header as it seems. Maybe for v4 to implement a real header (if not yet) A header doesn't need to be encrypted. (A bit for testing if

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Mike Shaver
On 8/22/05, Dennis Jenkins <[EMAIL PROTECTED]> wrote: > I very much disagree. I want the entire file, header included, to be > encrypted. Sometimes you don't want anyone to know what the file type > is. Security through obscurity is not secure. However, you don't want > to give the bad guys a

Re: [sqlite] Encryption and fixed header values (was Re: [sqlite] Why can i open a textfile?)

2005-08-22 Thread D. Richard Hipp
On Mon, 2005-08-22 at 17:19 -0400, Mike Shaver wrote: > On 8/22/05, Edwin Knoppert <[EMAIL PROTECTED]> wrote: > > Hmm, but every known file format has an header. > > Sqlite has a string, not really a header as it seems. > > Maybe for v4 to implement a real header (if not yet) > > A header doesn't

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread D. Richard Hipp
On Mon, 2005-08-22 at 23:12 +0200, Edwin Knoppert wrote: > Hmm, but every known file format has an header. > Sqlite has a string, not really a header as it seems. > Maybe for v4 to implement a real header (if not yet) > A header doesn't need to be encrypted. > (A bit for testing if it's encrypted

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Edwin Knoppert
50% o well just have us an indication, nothing counted. I meant 50% of this forum users, or... this planet, whatever. All i meant is that sqlite is created by a c programmer, like my colleague he seems to forget there are different languages but he doesn't care. Well, to keep cdecl functions

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Dennis Jenkins
Mike Shaver wrote: On 8/22/05, Dennis Jenkins <[EMAIL PROTECTED]> wrote: I very much disagree. I want the entire file, header included, to be encrypted. Sometimes you don't want anyone to know what the file type is. Security through obscurity is not secure. However, you don't want to

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Edwin Knoppert
At the other hand, this is database stuff, what on earth would you encrypt in real life business databases. No one cares, except for a few purposes. (Now i done it :) ) Encrypting a header, like if any virus writer is busy with a tool like sqlite.. pfffttt. - Original Message -

Re: [sqlite] Can you use random(*) to retrieve a pseudo random row from 3.2.3?

2005-08-22 Thread Dennis Cote
Brandon, Nicholas wrote: Hi, I trying to see if I can use the random(*) function to select a pseudo-random row and not sure if it will work as I expect. I want to use it to select a row based on two column values, however I suspect that each time random(*) is called in a single SQL line, it

RE: [sqlite] Why can i open a textfile?

2005-08-22 Thread Drew, Stephen
Point taken about viruses perhaps, but there are other reasons one might want to encrypt data - which by its very nature could be related to anything. For example, in a commercially competitive environment, it might be easy for a competitor to gain access to files, or even colleagues within

Re: [sqlite] Can you use random(*) to retrieve a pseudo random row from 3.2.3?

2005-08-22 Thread Dennis Cote
Dennis Cote wrote: Nick, Each call to the random() function in your statement generates a new random number. To reuse the same random number multiple times you need to save it somewhere. The SQL statement below should do what you want. It save the random number in a temp table which is

[sqlite] catching asserts from sqlite

2005-08-22 Thread Noel Burton-Krahn
Sqlite throws an assert() and crashes when it reads a corrupt db. (Sqlite is fine, our recording medium is flaky.) I'd like to catch the assert() and report an error without crashing. The problem is, sqlite throws assert() from functions that don't return an error code. So, there's no way

Re: [sqlite] Can you use random(*) to retrieve a pseudo random row from 3.2.3?

2005-08-22 Thread D. Richard Hipp
On Mon, 2005-08-22 at 16:54 -0600, Dennis Cote wrote: > select * > from MyTable > join (select random(*) as number) as rand > where start_col >= rand.number > and end_col < rand.number; > Very nice. Dennis Cote wins todays prize for cleverest use (abuse?) of a join! -- D. Richard Hipp <[EMAIL

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread Edwin Knoppert
Yes, the master thing is what i tried with the previous version. I guess i'll use it on the newest dll again. Not so important from now on. - Original Message - From: "Drew, Stephen" <[EMAIL PROTECTED]> To: ; Sent: Tuesday, August 23,

Re: [sqlite] Why can i open a textfile?

2005-08-22 Thread D. Richard Hipp
On Tue, 2005-08-23 at 00:04 +0200, Edwin Knoppert wrote: > All i meant is that sqlite is created by a c programmer, like my colleague > he seems to forget there are different languages but he doesn't care. > Actually, I'm a TCL programmer. I only resort to C code to write new TCL extensions.

Re: [sqlite] catching asserts from sqlite

2005-08-22 Thread D. Richard Hipp
On Mon, 2005-08-22 at 16:09 -0700, Noel Burton-Krahn wrote: > Sqlite throws an assert() and crashes when it reads a corrupt db. (Sqlite > is fine, our recording medium is flaky.) I'd like to catch the assert() and > report an error without crashing. > > The problem is, sqlite throws assert()

[sqlite] simple create db question

2005-08-22 Thread Jim McNamara
Hi- i always use to use tcl and created my db that way or used a tool with that menu option. now i'd like to use the command line to do it. i have a sqlite3.exe command utility in a directory named c:\aTest. i tried c:\aTest> "sqlite3 t1.db" and get an error message. what i am looking in to

[sqlite] re: create db question---command line

2005-08-22 Thread Jim McNamara
i just needed to use java -jar sqlite.jar t1.db now my computer is associating db files with sqlite because paradox is on the computer. great...oh well...that will be my next thing to fix if i can. thanks, later __ Yahoo! Mail Stay connected,

[sqlite] Maximum num of tables?

2005-08-22 Thread Chris Schirlinger
I looked around, the FAQ, Wiki and history of this list but didn't see any solid reply Does anyone know what the maximum number of tables a SQLite 3.0 database can hold? We've got one that has 11k or so and it seems fine, but I am worried we may hit a limit

Re: [sqlite] catching asserts from sqlite

2005-08-22 Thread Noel Burton-Krahn
Really? Great. I'll try one of my corrupt files against the latest sqlite then. If it still asserts, I'll attach the db to a new bug report. Thanks, --Noel - Original Message - From: "D. Richard Hipp" <[EMAIL PROTECTED]> To: Sent: Monday, August 22, 2005

[sqlite] How to insert a binary file into the database of sqlite in C++?

2005-08-22 Thread 我本楚狂人 , 凤歌笑孔丘!
I have search with Google , and find these information as below sqlite3_prepare(..., "insert into foo values(?);", -1, , ...); sqlite3_bind_blob(stmt, 1, "bar", 3, SQLITE_TRANSIENT); sqlite3_step(stmt); But if there is a file in this path "C:\a.mp3", I use "ifstream mp3("C:\\a.mp3") open this