SV: [sqlite] sqlite segfault using libc library

2007-03-24 Thread Christer Engman
Yes it's same massage in this 3 PC's -Ursprungligt meddelande- Från: Rich Rattanni [mailto:[EMAIL PROTECTED] Skickat: den 24 mars 2007 22:23 Till: sqlite-users@sqlite.org Ämne: Re: [sqlite] sqlite segfault using libc library On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote: > Andrew Fi

[sqlite] Store and retreive 0D0A (CRLF) in string field

2007-03-24 Thread fangles
When I have text pasted into an sqlite string field, it is stored okay but when I retrieve a string, it is truncated at the first CR (0D). Does anyone know how to handle this by any chance? -- View this message in context: http://www.nabble.com/Store-and-retreive-0D0A-%28CRLF%29-in-string-field

Re: [sqlite] How does SQLite store data?

2007-03-24 Thread drh
"Jonathon Blake" <[EMAIL PROTECTED]> wrote: > John wrote: > > > A TEXT string is stored at its actual length. You may declare a text > > column as 80 characters wide but you could store a string 32K long in > > that column. The 80 is stored by Sqlite but ignored. > > Stupid question. > > Does

Re: [sqlite] sub-query optimization question

2007-03-24 Thread drh
"Kevin Alons" <[EMAIL PROTECTED]> wrote: > Using sqlite 3.3.13, I have the following query: > > SELECT v.tID > FROM (SELECT tID FROM Test WHERE funcFast(1, tID) = 1) v > WHERE v.tID IN (SELECT tID FROM Test WHERE funcSlow(tID) GLOB 'abc*'); > > WHERE funcFast is a function which does something t

[sqlite] sub-query optimization question

2007-03-24 Thread Kevin Alons
Using sqlite 3.3.13, I have the following query: SELECT v.tID FROM (SELECT tID FROM Test WHERE funcFast(1, tID) = 1) v WHERE v.tID IN (SELECT tID FROM Test WHERE funcSlow(tID) GLOB 'abc*'); WHERE funcFast is a function which does something that executes quickly, and funcSlow is a function that

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread Rich Rattanni
On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote: Andrew Finkenstadt wrote: > On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote: > >> >> Compilers do not terminate strings, library functions do. > > > > You are guaranteed by the C standard that the string referred to by > >>> const char messag

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread John Stanton
Andrew Finkenstadt wrote: On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote: Compilers do not terminate strings, library functions do. You are guaranteed by the C standard that the string referred to by const char message[] = "this string"; is null-terminated by the compiler. Of cou

Re: [sqlite] How does SQLite store data?

2007-03-24 Thread John Stanton
There are no stupid questions. only stupid answers. Sqlite stores the entire length of the string and never truncates. Its TEXT type handles every string, provided that it is text, otherwise it needs to be a BLOB (e.g. a JPEG). Sqlite is simpler than you can imagine to use because its manife

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread Andrew Finkenstadt
On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote: Compilers do not terminate strings, library functions do. You are guaranteed by the C standard that the string referred to by const char message[] = "this string"; is null-terminated by the compiler.

Re: [sqlite] How does SQLite store data?

2007-03-24 Thread Jonathon Blake
John wrote: A TEXT string is stored at its actual length. You may declare a text column as 80 characters wide but you could store a string 32K long in that column. The 80 is stored by Sqlite but ignored. Stupid question. Does that mean that SQLite: * truncates the field at 80 characters? *

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread John Stanton
Compilers do not terminate strings, library functions do. The most common errors causing major problems in library functions are buffer overflows. Assuming that library routines terminate strings and check for buffer sizes is a common error which has made the task of security crackers easy an

SV: [sqlite] sqlite segfault using libc library

2007-03-24 Thread Christer Engman
I have install this application in 24 PC's and its only 3 PC's where the application not work it's creates map but not database? -Ursprungligt meddelande- Från: Rich Rattanni [mailto:[EMAIL PROTECTED] Skickat: den 24 mars 2007 17:37 Till: sqlite-users@sqlite.org Ämne: Re: [sqlite] sqlit

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread Rich Rattanni
Just because you have a pointer assigned to the string does not ensure that it is terminated. It only finds the start of the string. You need a null character at the end. I understand that John, but these strings I am writing to the database are declared as follows... const char message[] = "

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread John Stanton
Just because you have a pointer assigned to the string does not ensure that it is terminated. It only finds the start of the string. You need a null character at the end. Rich Rattanni wrote: I agree, but all my strings are const char *, and I do not modify them during program execution. On

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread Rich Rattanni
Maybe using an invalid UTF-8 string as input to SQLite? Maybe your wrapper uses strlen to find the end of the string and that is different from the SQL string length function of SQLite, which may be diferent on UTF-8 strings? My wrapper class never uses strlen(). Instead I bind the string to th

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread Nuno Lucas
On 3/24/07, Rich Rattanni <[EMAIL PROTECTED]> wrote: I agree, but all my strings are const char *, and I do not modify them during program execution. Maybe using an invalid UTF-8 string as input to SQLite? Maybe your wrapper uses strlen to find the end of the string and that is different from t

Re: [sqlite] sqlite and bcc32

2007-03-24 Thread Nuno Lucas
On 3/24/07, stripe <[EMAIL PROTECTED]> wrote: Build sqlite3.lib with Borland Free Tools 5.5.1 correctly. Using it with someprog.c everithing is OK, but when I change to .cpp got Error E2232 /sqlite/open/sqlite3.h 1712: Constant member 'sqlite3_index_info::nConstraint' in class without constructo

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread Rich Rattanni
I agree, but all my strings are const char *, and I do not modify them during program execution. On 3/24/07, John Stanton <[EMAIL PROTECTED]> wrote: It looks like you might have an unterminated string. Rich Rattanni wrote: > All: >I am writing an application that heavily logs all activity t

Re: [sqlite] sqlite segfault using libc library

2007-03-24 Thread John Stanton
It looks like you might have an unterminated string. Rich Rattanni wrote: All: I am writing an application that heavily logs all activity to a sqlite3 database. Last night, while running some extended testing, I caught a segmentation fault. The core dump isnt of much help... (gdb) bt #0 0

Re: [sqlite] Count of rows in every table

2007-03-24 Thread Nuno Lucas
On 3/23/07, Noah Hart <[EMAIL PROTECTED]> wrote: Using only SQLite and SQL, is there a way to get a count of rows in each table in the database? I know I can do this via an external application to query sqlite_master and using that list, query a row count of each table, but would prefer to find

Re: [sqlite] How does SQLite store data?

2007-03-24 Thread John Stanton
Sqlite has a concept called "manifest typing" where it makes decisons on how to store data. It does not have fixed length columns except for the ones which hold integer and real numbers and boolean values. A TEXT string is stored at its actual length. You may declare a text column as 80 char

[sqlite] sqlite segfault using libc library

2007-03-24 Thread Rich Rattanni
All: I am writing an application that heavily logs all activity to a sqlite3 database. Last night, while running some extended testing, I caught a segmentation fault. The core dump isnt of much help... (gdb) bt #0 0x403d2934 in strlen () from /lib/libc.so.6 #1 0x401add60 in ?? () from /usr

[sqlite] sqlite and bcc32

2007-03-24 Thread stripe
Build sqlite3.lib with Borland Free Tools 5.5.1 correctly. Using it with someprog.c everithing is OK, but when I change to .cpp got Error E2232 /sqlite/open/sqlite3.h 1712: Constant member 'sqlite3_index_info::nConstraint' in class without constructors Error E2232 /sqlite/open/sqlite3.h 1712: Co