Re: [sqlite] Possible memory leaks in shell.c

2007-07-02 Thread Dan Kennedy
On Mon, 2007-07-02 at 18:46 -0500, Ben Combee wrote: > This one's in shell.c. In process_input(), zLine is assigned using > > zLine = one_input_line(zSql, in); > > Usually, you hit the free(zLine) call in one of the code paths before > repeating the while loop. However, on line 1614 > >

Re: [sqlite] Problem: SQLite C++ Examples in the SQLite Documentation No Longer Work; Can't See Tables in Database

2007-07-02 Thread Ritesh Kapoor
Try connecting to this database using the SQLite command line browser and then check if the table 'tb1' exists. Most probably it dosen't. You can check which all tables have been created using the query - "select * from sqlite_master" Regards, Ritesh > I've had to do a complete backtrack today.

Re: [sqlite] iPhone

2007-07-02 Thread Will Leshner
On 7/2/07, RaghavendraK 70574 <[EMAIL PROTECTED]> wrote: Congratulations to DRH and all. I Just love this beast,incredibly small but with monster features. Of course, SQLite is already a big part of Mac OS X. It is the "core" of Core Data: I

Re: [sqlite] iPhone

2007-07-02 Thread RaghavendraK 70574
Definitely not iPhone. regards ragha ** This email and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of

Re: [sqlite] iPhone

2007-07-02 Thread P Kishor
On 7/2/07, RaghavendraK 70574 <[EMAIL PROTECTED]> wrote: Congratulations to DRH and all. I Just love this beast,incredibly small but with monster features. hmmm now, is that a phone in your pocket, or is it just that your database is happy to see me? Which beast are we talking about her

Re: [sqlite] iPhone

2007-07-02 Thread RaghavendraK 70574
Congratulations to DRH and all. I Just love this beast,incredibly small but with monster features. regards ragha ** This email and its attachments contain confidential information from HUAWEI, which is inte

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread Israel Figueroa
I think that what you need is a sequence... but sqlite doesn't implement sequiences. A workarround cuold be to create a table with no data on it.. but used to create a unique index which can be used to insert data on the others tables. To know the id you should use the sqlite3_last_insert_rowid fu

[sqlite] Possible memory leaks in shell.c

2007-07-02 Thread Ben Combee
This one's in shell.c. In process_input(), zLine is assigned using zLine = one_input_line(zSql, in); Usually, you hit the free(zLine) call in one of the code paths before repeating the while loop. However, on line 1614 if( (zSql==0 || zSql[0]==0) && _all_whitespace(zLine) ) continue; you

[sqlite] Problem: SQLite C++ Examples in the SQLite Documentation No Longer Work; Can't See Tables in Database

2007-07-02 Thread Lee Crain
I've had to do a complete backtrack today. I went back to where I was 3 weeks ago. I used the SQLite command line documentation to create the "ex1" database and enter 2 data records, exactly as the example shows. Then, I copied and pasted the SQLite C++ example into my program and attempted

[sqlite] Problem: Can't See Tables in Database

2007-07-02 Thread Lee Crain
I have 2 databases created and populated: > DBLee, my test database > MiniMain, a subset copy of one of our production databases >From the sqlite3 command prompt, I can run queries against both databases and see the results. I can also enter the ".tables" command and see the correct list of

Re: [sqlite] Possible memory leak in select.c

2007-07-02 Thread Ben Combee
On 7/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "Ben Combee" <[EMAIL PROTECTED]> wrote: > Won't this code leak the memory to which zName points during the > assignment from the call to sqlite3MPrintf? > The %z calls sqliteFree() for you automatically. Thanks for the clarification. One

Re: [sqlite] Possible memory leak in select.c

2007-07-02 Thread drh
"Ben Combee" <[EMAIL PROTECTED]> wrote: > This is something the Coverity caught when run locally on the SQLite > 3.3.17 source, but it seems to still be there in the CVS version: > > In select.c's sqlite3ResultSetOfSelect(), zName is allocated using a > malloc-style function at the top of the rout

[sqlite] Possible memory leak in select.c

2007-07-02 Thread Ben Combee
This is something the Coverity caught when run locally on the SQLite 3.3.17 source, but it seems to still be there in the CVS version: In select.c's sqlite3ResultSetOfSelect(), zName is allocated using a malloc-style function at the top of the routine. Later, there's code to guarantee a unique n

Re: [sqlite] iPhone

2007-07-02 Thread Rich Shepard
On Mon, 2 Jul 2007, [EMAIL PROTECTED] wrote: Rich, can you bring this to attention of Steve Jobs for me. ;-) Well, I'd be happy to, but he would most likely ignore any email message I sent. More to the point, he wouldn't care. Rich -- Richard B. Shepard, Ph.D. |The Envir

[sqlite] error 404

2007-07-02 Thread Frederic de la Goublaye
Hi all I am sorry to disturb you with my questions. Since the javaslite driver update, http://www.ch-werner.de/javasqlite/ date:2007-06-26 http://www.ysalaya.org regullary crashes on HTTP error 404 I need to restart Apache 22. I need also to restart Tomcat If not there is no access to the SQ

[sqlite] Small code comment fix

2007-07-02 Thread Ben Combee
In reading the SQLite source, I think I spotted a cut-and-paste error in a comment: In build.c in the parameter list for sqlite3CreateIndex, pStart is described as Token *pStart, /* The CREATE token that begins a CREATE TABLE statement */ Shouldn't that be "CREATE INDEX"?

Re: [sqlite] iPhone

2007-07-02 Thread drh
Rich Shepard <[EMAIL PROTECTED]> wrote: > On Mon, 2 Jul 2007, Peter van Dijk wrote: > > > Apple's new iPhone uses SQLite 3.1.3 to manage its database of certificates > >Well, then: imagine how much more folks would have had to pay to cover the > costs of developing their own dbms, or licensin

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread Clark Christensen
http://www.mail-archive.com/sqlite-users@sqlite.org/msg10803.html Describes a patch that implements a sequence table, and functions to deal with it. You could use something like that to implement a unique-across-all-tables ID scheme. Though I think someone else (Igor?) already suggested someth

Re: [sqlite] iPhone

2007-07-02 Thread Rich Shepard
On Mon, 2 Jul 2007, Peter van Dijk wrote: Apple's new iPhone uses SQLite 3.1.3 to manage its database of certificates Well, then: imagine how much more folks would have had to pay to cover the costs of developing their own dbms, or licensing a commercial one. Rich -- Richard B. Shepard, Ph

[sqlite] iPhone

2007-07-02 Thread Peter van Dijk
Apple's new iPhone uses SQLite 3.1.3 to manage its database of certificates :) Cheers, Peter - To unsubscribe, send email to [EMAIL PROTECTED] ---

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread Teg
Hello Andre, I'd probably add a single table that does nothing but, supply auto-increment values to the other tables. You'd only have "autoincrement" in this one table then when you need a unique number, insert into the link table, get the rowid/autoincrement value and then use this value for the

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread drh
"P Kishor" <[EMAIL PROTECTED]> wrote: > On 7/2/07, Andre du Plessis <[EMAIL PROTECTED]> wrote: > > > > I would like to know how to create an Autoincrement field and insure > > that it is unique across the database, > > 1. Use a GUID, or > 2. Use some kind of crypt/md5 kinda function on a random s

RE: [sqlite] Re: Database Level Unique Sequence

2007-07-02 Thread Andre du Plessis
That could work, but it is extra work, just hoped it was available, would make life easier, and not need extra columns in an already very large link table, and also extra conditions in the select. But if there is no other way I'll go this route. I guess one nice feature that they may consider for

RE: [sqlite] Database Level Unique Sequence

2007-07-02 Thread Griggs, Donald
Re: "I would like to know how to create an Autoincrement field and insure that it is unique across the database [not just within one table]...] Hi Andre, Do you mind saying why it is you need the field to be unique across all tables? Wouldn't the fact that a key is unique within its own table

Re: [sqlite] Database Level Unique Sequence

2007-07-02 Thread P Kishor
On 7/2/07, Andre du Plessis <[EMAIL PROTECTED]> wrote: Good day everyone. I would like to know how to create an Autoincrement field and insure that it is unique across the database, I tested this and it does not seem to work: .. 1. Use a GUID, or 2. Use some kind of crypt/md5 kinda function o

[sqlite] Re: Database Level Unique Sequence

2007-07-02 Thread Igor Tandetnik
Andre du Plessis <[EMAIL PROTECTED]> wrote: I would like to know how to create an Autoincrement field and insure that it is unique across the database, I tested this and it does not seem to work: I need this because I need a link table that wont know which table the id comes from, and I cant add

Re: [sqlite] Re: In Mem Query Performance

2007-07-02 Thread Ken
Timings: Calling Test Now TIME_ms=1210 start=1183394494 end=1183394496 Calling Test Now TIME_ms=1164 start=1183394504 end=1183394505 (time in Ms is 1.2 and 1.1 ... ) Data generated using: #include #include #include #include using namespace std; int main() { fstr

[sqlite] Database Level Unique Sequence

2007-07-02 Thread Andre du Plessis
Good day everyone. I would like to know how to create an Autoincrement field and insure that it is unique across the database, I tested this and it does not seem to work: c:\Temp>sqlite3 temp.db SQLite version 3.3.17 Enter ".help" for instructions sqlite> create table temptable (id integ

Re: [sqlite] Seg Fault when using sqlite3_bind_blob

2007-07-02 Thread Ken
Rich, just a performance note, try the following logic: sqlite3_exec(db, "BEGIN IMMEDIATE", NULL, NULL, NULL); sqlite3_prepare(db, "INSERT INTO table1 (blobData) VALUES (?1)", -1, &stmt, NULL); -For each blob... sqlite3_bind_blob(stmt, 1, blobData, blobSize, SQLITE_TRANSIENT); s

[sqlite] Generating documentation (mingw, activestate tcl)

2007-07-02 Thread Mario Figueiredo
Hello all, Sorry for the basic question. Sure it must be. I seem to not be able to correctly generate the SQLite html files. My setup is the following: Windows XP MinGW 3.4.5 ActiveState TCL 8.4.14 I have absolutely 0 knowledge on TCL. I downloaded ActiveState specifically because of SQLite do

Re: [sqlite] Seg Fault when using sqlite3_bind_blob

2007-07-02 Thread Rich Rattanni
I wish I could run valgrind, but this project is running on an ARM chip and there is no port for the ARM last I checked. Thanks for checking my code. -- Rich Rattanni On 7/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "Rich Rattanni" <[EMAIL PROTECTED]> wrote: > > sqlite3_exec(db, "BEGIN

Re: [sqlite] SQL query assistance...

2007-07-02 Thread Jeff Godfrey
- Original Message - From: "Dan Kennedy" <[EMAIL PROTECTED]> To: Sent: Monday, July 02, 2007 4:17 AM Subject: Re: [sqlite] SQL query assistance... On Sun, 2007-07-01 at 16:31 -0500, Jeff Godfrey wrote: Hi All, Given the following sample data... ID Name Version --- - ---

Re: [sqlite] Seg Fault when using sqlite3_bind_blob

2007-07-02 Thread drh
"Rich Rattanni" <[EMAIL PROTECTED]> wrote: > > sqlite3_exec(db, "BEGIN IMMEDIATE", NULL, NULL, NULL); > -For each blob... > sqlite3_prepare(db, "INSERT INTO table1 (blobData) VALUES (?1)", -1, > &stmt, NULL); > sqlite3_bind_blob(stmt, 1, blobData, blobSize, SQLITE_TRANSIENT); > sqlite3_step(stmt);

Re: [sqlite] Seg Fault when using sqlite3_bind_blob

2007-07-02 Thread Dan Kennedy
On Mon, 2007-07-02 at 08:51 -0400, Rich Rattanni wrote: > I think I am incorrectly using the API, which may be leading to my > segmentation fault... > > I have a variable amount (22k -> 1MB) of data, split across several > blobs to insert into a database. I transactify the process to save > some

Re: [sqlite] Seg Fault when using sqlite3_bind_blob

2007-07-02 Thread Rich Rattanni
I think I am incorrectly using the API, which may be leading to my segmentation fault... I have a variable amount (22k -> 1MB) of data, split across several blobs to insert into a database. I transactify the process to save some time (alot by my tests). sqlite3_exec(db, "BEGIN IMMEDIATE", NULL,

Re: [sqlite] Re: In Mem Query Performance

2007-07-02 Thread Eduardo Morras
At 12:16 02/07/2007, you wrote: Hi, Pls notify me if it can be brought down to 1 sec. There is no mem constraint. I don't know x86 asm or gcc for x86, but in powerpc asm, if i use altivec libraries (libfreevec, f.e.) for string comparations, mem moves/copies, sorts etc... i get from x2 to x1

Re: [sqlite] Re: In Mem Query Performance

2007-07-02 Thread RaghavendraK 70574
Hi, Pls notify me if it can be brought down to 1 sec. There is no mem constraint. regards ragha ** This email and its attachments contain confidential information from HUAWEI, which is intended only for the

Re: [sqlite] SQL query assistance...

2007-07-02 Thread Dan Kennedy
On Sun, 2007-07-01 at 16:31 -0500, Jeff Godfrey wrote: > Hi All, > > Given the following sample data... > > ID Name Version > --- - --- > 1 name1 0.9 > 2 name1 1.0 > 3 name2 1.2 > 4 name3 1.0 > 5 name3 1.7 > 6 name3 1.5 > > I need to create a query that will group the