[sqlite] Bitwise 'AND' issue with bound variables

2007-07-30 Thread Kervin L. Pierre
Hello, I'd been looking into a bug in my application which worked down to an issue with Bitwise AND and bound variables in prepared statements it seems. The query... SELECT * FROM example WHERE (intColumn & 4294901760) = ? Where 'intColumn' is an integer column and the parameter is bound using

[sqlite] Shouldn't this query work?

2007-08-27 Thread Kervin L. Pierre
Hello, I've been wrestling with this issue for a long while now so I am hoping some could give some indication to what I am doing wrong. I expected this script to work... create table testtable ( testcol int ); insert into testtable ( testcol ) values ( -2146369472 ) select * from testtable

Re: [sqlite] Re: Shouldn't this query work?

2007-08-29 Thread Kervin L. Pierre
Hello Igor, Thanks. That was the problem. I had been doing 32 bit math on SQLite's 64 bit integers. Best regards, Kervin --- Igor Tandetnik <[EMAIL PROTECTED]> wrote: > Kervin L. Pierre > > wrote: > > I expected this script to work... > > > > cre

Re: [sqlite] sqlite3_free()

2006-06-28 Thread Kervin L. Pierre
Hello, --- Dennis Cote <[EMAIL PROTECTED]> wrote: > This really has nothing to do with the Windows DLL > system. It is simply Thanks for the explanation. Wondered what that bug reporter was talking about :) There's a lot Windows does wrong, we don't have to go around making up stuff :)

[sqlite] Need help with query optimization

2006-09-11 Thread Kervin L. Pierre
Hello, I working on a function in our open-source Outlook plugin [ http://openconnector.org ] and I've run into some speed issues. We've been avoiding optimizing for speed till later but this function is currently operating at 3 orders of magnitude worse than acceptible and is slowing down

Re: [sqlite] Need help with query optimization

2006-09-11 Thread Kervin L. Pierre
what happens. Best regards, Kervin --- Dennis Cote <[EMAIL PROTECTED]> wrote: > Kervin L. Pierre wrote: > > I'd appreciate any help or > > pointers optimizing the SQL in the main > > loop. > > > > for( 'large number' ){ > > // query1 > &g

[sqlite] sqlite_exec query string maximum length?

2006-09-17 Thread Kervin L. Pierre
Hello, My application is building a query string with multiple queries. The number of queries depends on the user and for performance, I would like to execute as few sqlite_exec() calls as possible. So my question what is the maximumm number of characters there can be in a query string sent to

Re: [sqlite] sqlite_exec query string maximum length?

2006-09-18 Thread Kervin L. Pierre
Hello, Thanks. Best regards, Kervin --- [EMAIL PROTECTED] wrote: > "Kervin L. Pierre" <[EMAIL PROTECTED]> wrote: > > what is the maximumm number > > of characters there can be in a query > > string sent to sqlite_exec()? > > 2147483647 bytes &g

Re: [sqlite] sqlite_exec query string maximum length?

2006-09-18 Thread Kervin L. Pierre
Hello, Thanks for the explaination. Looks like this isn't going to help me after all. Thought sqlite3_exec() would compile the query only once. Best regards, Kervin --- Dennis Cote <[EMAIL PROTECTED]> wrote: > Kervin L. Pierre wrote: > > and for performance, I would like to exe

[sqlite] How long can I keep a prepared statement around?

2006-09-24 Thread Kervin L. Pierre
Hello, I have a few queries that are executed very often. I would like to keep them around as much as possible. The problem is, I don't know what 'invalidates' a prepared statement. In other words, when can I expect to have to 're-'prepare a statement? How long can I keep a prepared

Re: [sqlite] Re: How long can I keep a prepared statement around?

2006-09-24 Thread Kervin L. Pierre
Hello Igor, Thanks for the info. Best regards, Kervin --- Igor Tandetnik <[EMAIL PROTECTED]> wrote: > Kervin L. Pierre > > wrote: > > The problem is, I don't know what > > 'invalidates' a prepared statement. In > > other words, when can I expect to hav

Re: [sqlite] How long can I keep a prepared statement around?

2006-09-24 Thread Kervin L. Pierre
Hello Michael, Thanks. Best regards, Kervin --- Michael Ruck <[EMAIL PROTECTED]> wrote: > Use the function sqlite3_expired to determine, when > you need to > recompile a prepared statement. That's the approach > I use. > > Mike > > Am 24.09.2006 um

Re: [sqlite] Please test check-ins [3445] and [3446]

2006-09-26 Thread Kervin L. Pierre
Hello, I just tried. I am getting build errors for CVS. 3.3.7 builds though. Error 101 error C2065: 'SQLITE_FUNCTION' : undeclared identifier c:\src\sqlite\sqlite\src\expr.c 1185 Error 121 error C2065: 'sqlite3_overload_function' : undeclared identifier

Re: [sqlite] Q about new SQLite API

2006-11-07 Thread Kervin L. Pierre
Hello, Thanks for the improvements! Q1 Any name would be find, though the 'ex' extension seems to be popular for that sought of thing. Q2 A non-blocking resultset API? :) Sorry, had to try. Q3 I think this should be a new error for the caution's sake. But overall I prefer more, finer grain,

Re: [sqlite] ANN: SQLite .NET provider updated

2008-07-17 Thread Kervin L. Pierre
I have to say SQLite.NET, like SQLite itself is an incredible piece of software. - Original Message > From: Harold Wood <[EMAIL PROTECTED]> > To: General Discussion of SQLite Database > Sent: Wednesday, July 16, 2008 11:46:29 PM > Subject: Re: [sqlite] ANN:

Re: [sqlite] System function with Sqlite

2008-08-18 Thread Kervin L. Pierre
Hello Chris, It looks like you've been dealing with this for a while now. 1. Try these extra gcc flags in your build... "-Wall -Wconversion -Wshadow". Also try renaming your database handle to something more unique. 2. Have you tried 'strace' like someone else suggested? 3.

Re: [sqlite] Multi-threading.

2005-07-16 Thread Kervin L. Pierre
Paul G wrote: richard's advice is solid. use async io/event loops if possible, separate processes if possible, threads as a last resort, in that order. the grey area is the 'if possible' test, since it's a multi-way tradeoff between performance, simplicity and provable (to an extent)

Re: [sqlite] Multi-threading.

2005-07-26 Thread Kervin L. Pierre
Mrs. Brisby wrote: chances are you can't use threads correctly either. This mailing list is an excellent example of how many "professional programmers" simply can't deal with threads- every problem they run into, it's "how do I make sqlite work with threads". If you have to ask that question,

Re: [sqlite] Segmentation fault on large selects

2005-08-01 Thread Kervin L. Pierre
scunacc wrote: I have built with debugging on, and can't do anything with the core dump: dbx Type 'help' for help. enter object file name (default is `a.out', ^D to exit): sqlite3 reading symbolic information ... [using memory image in core] Illegal instruction (reserved addressing fault)

Re: [sqlite] Segmentation fault on large selects

2005-08-02 Thread Kervin L. Pierre
Sorry, I read your trace wrong, thought the debugger was complaining. What does the the 'where' command say? scunacc wrote: Dear Kervin, Can you run the sqlite3 under dbx? You may have better luck getting a backtrace that way instead of reading the core file after the crash. eg. 'dbx -r

[sqlite] table or record size without reading the entire table/record?

2005-08-21 Thread Kervin L. Pierre
Hello, I am trying to figure out a way to return the actual or approximate table size in a database. Basically, in my application a table relates to an object and I need to calculate the approximate size of an object. There is the sqlite3_column_bytes(), but I understand that that function

Re: [sqlite] table or record size without reading the entire table/record?

2005-08-21 Thread Kervin L. Pierre
D. Richard Hipp wrote: Are you trying to estimate the size of a table, or a single row in that table? Your words say the table but the context suggest you really want the size of a row. I need the table. But I thought if I could have the row, calculating the total for the table wouldn't

Re: [sqlite] Unlucky number for the ROUND function

2005-08-30 Thread Kervin L. Pierre
Interesting... Bankers' Rounding http://blogs.msdn.com/ericlippert/archive/2003/09/26/53107.aspx Brass Tilde wrote: From: "Bob Dankert" Using an older version which I compiled, I get 9.9, though it seems it should round up to 10.0? This may be dependent upon the math library linked

Re: [sqlite] Unlucky number for the ROUND function

2005-08-30 Thread Kervin L. Pierre
8.256.5680 f. 608.256.3780 -Original Message- From: Kervin L. Pierre [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 30, 2005 12:18 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Unlucky number for the ROUND function Interesting... Bankers' Rounding http://blogs.msdn.com/ericlip

Re: [sqlite] Problems with threadsafe opt correction #2623

2005-08-31 Thread Kervin L. Pierre
Hello, Is this the only reason for the... "database handle can only be used on the same thread that opened it" ...rule? Does Windows have that issue? If so, can we convert this to a compile time option? Eg. OS_SUPPORTS_THREADSAFE_FILE_LOCKS or similar flag which can be set to true for OSes

Re: [sqlite] What's the safest, most elegant way to copy a live db.

2005-09-06 Thread Kervin L. Pierre
Hello, Seems to me if your backup program does a "BEGIN EXCLUSIVE" before doing the file copy then you should be fine. Just my guess though. I believe an exclusive transaction should ensure that you are the only writer to the database. Regards, Kervin John Duprey wrote: I'd like to copy a

Re: [sqlite] CROSS keyword disables certain join optimizations

2005-09-10 Thread Kervin L. Pierre
Darren Duncan wrote: At 7:25 PM -0400 9/10/05, D. Richard Hipp wrote: Well, that's fine as long as CROSS still continues to mean and do what it has always meant, which is that you explicitly want the result set of If I understand the issue correctly, it does. "FROM a, b" is usually

[sqlite] any plans for out-of-row blobs?

2005-09-13 Thread Kervin L. Pierre
I need to retrieve parts of the Blob column value. The blob may simply be to large for memory at runtime. There is no way to retrieve part of a blob value in SQLite. From my understanding, most databases store blob values separate from the rest of the row. Would that be a possibility for

Re: [sqlite] FAQ clarification

2005-09-16 Thread Kervin L. Pierre
Christian Smith wrote: I went through the link you had sent. This page mentions 5 different types of locks which are provided by the pager module in SQLite. Could you please clarify these 2 doubts - 1. My application uses our own Mutex variables to allow single reader/writer operation -

Re: [sqlite] query problem

2005-09-19 Thread Kervin L. Pierre
D. Richard Hipp wrote: Hence, the result set contains no rows. A COUNT() of a empty result set gives NULL. I thought per the last discussion on "Sum and NULL" that the count of an empty set would return zero. Regards, Kervin

Re: [sqlite] sqlite with java + hibernate

2005-10-11 Thread Kervin L. Pierre
SQLite is a great database, but if you're using Java, why not use something like Apache Derby ( http://db.apache.org/derby/ )? Regards, Kervin Christoph Langewisch wrote: Hello, I'm looking for an embedded SQL database and found SQLite. Now I need some information I did not found at the page

Re: [sqlite] Sqlite and Java

2006-01-19 Thread Kervin L. Pierre
Cloudscape, which was given to Apache foundation and is now the Apache Derby Project. http://db.apache.org/derby/ Jonathan Ballet wrote: I think you're talking of http://hsqldb.org/, used among other project by OpenOffice ...

[sqlite] Simple ATTACH/memory database question

2006-02-14 Thread Kervin L. Pierre
Hello, We are getting ready to start using in- memory database to cache sqlite reads/writes in effort to improve speed. For background, the application is an email client. The way we envision the caching working is that we have a mirror copy of any table in use in memory. The tables are small

Re: [sqlite] Simple ATTACH/memory database question

2006-02-14 Thread Kervin L. Pierre
[EMAIL PROTECTED] wrote: I'm reading and replying to this message using an SQLite-backed email client See That's very interesting... All incoming and archival emails are stored as BLOBs in a table. The full text of messages is indexed. It is all very fast and I haven't had to do anything

Re: [sqlite] Simple ATTACH/memory database question

2006-02-14 Thread Kervin L. Pierre
[EMAIL PROTECTED] wrote: Is this right? You are doing a separate CREATE TABLE for each message? That's going to be the source of your problem. I think Yes we are. I tried a message/row design early on but I could not count on it being behaving well. The problem was fitting Outlook's

Re: [sqlite] :memory: and sessions with PHP

2006-02-14 Thread Kervin L. Pierre
Hello, I think the problem is that PHP uses a file-based session serialization. Therefore anything that cannot be saved to a file and returned ( eg. you can't do this with file handles, etc. ) cannot be saved in session scope in PHP as it is implemented by default. There is the 'mm' extension

Re: [sqlite] Shared Memory Question

2006-02-15 Thread Kervin L. Pierre
Hello, We are currently looking at this very issue ourselves. I just put in an enhancement request... http://www.sqlite.org/cvstrac/tktview?tn=1679 For allowing the runtime replacement of memory functions by using function pointers instead of C mallocs. We could then replace SQLite's

[sqlite] memory database, ATTACH, and threads

2006-02-28 Thread Kervin L. Pierre
Hello, I am not sure if that is exactly the problem, but it seems that sqlite3_prepare() deadlocks when called to attach a in-memory database that is already attached. The second ATTACH occurs on a separate thread with a separate handle to a database that is already opened in the process. Is

Re: [sqlite] concers about database size

2006-03-16 Thread Kervin L. Pierre
Hello Daniel, Daniel Franke wrote: Was sqlite designed for those numbers? The docs state that sqlite supports "databases up to 2 terabytes in size". OTOH, "supports" is not the same as "works-well-with"?! Any suggestions whether my descision to use sqlite was appropiate for this table design?

Re: [sqlite] Enabling Memory Management in 3.3.4

2006-03-20 Thread Kervin L. Pierre
Alexander Roston wrote: > I asked the compiler to show me a list of the library routines and "sqlite3_release_memory" was not present. shouldn't that give you a link error rather than a segfault? Guessing that if your program linked properly the linker found the function somewhere. Maybe

Re: [sqlite] Problems with multiple threads?

2006-06-08 Thread Kervin L. Pierre
Hello, I was under the impress that we could never get an SQLITE_BUSY, not even on COMMIT if we use BEGIN EXCLUSIVE. But this seems to say that COMMITs on exclusive transactions can through SQLITE_BUSY?... --- [EMAIL PROTECTED] wrote: > then start the transaction initially with BEGIN >

[sqlite] function pointers? - Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-08 Thread Kervin L. Pierre
Hello, Regardless of program loading design, wouldn't this feature be better coded using function pointers? Ie. Have a "register/load" function that maps functions in the exe? PS. It would be helpful to have sqlite3OSMalloc() and sqlite3OSFree() as function pointers as well, so an application

[sqlite] how are people dealing with threading?

2005-01-29 Thread Kervin L. Pierre
Hello, I am writing an application that uses sqlite in a multithreaded environment. The application is a plugin for microsoft Outlook ( http://openconnector.org/ ) and hence I do not have full control over how my objects are passed amongst threads. I am trying to keep a hash map of

[sqlite] still struggling with "Database schema has changed" errors

2005-02-03 Thread Kervin L. Pierre
Hello, I am using SQLite 3.0.8 in a Win32 threaded environment. I keep getting random "Database schema has changed" errors even though I am using thread local storage to make sure sqlite3_open() gets called on each thread and a there is a sqlite3* per thread. Has anyone had any luck with resolving

Re: [sqlite] still struggling with "Database schema has changed" errors

2005-02-04 Thread Kervin L. Pierre
Hi, Thanks for your response. I'm at wit's end with this thing. I do open the database multiple times, but exactly once per thread. I then keep the sqlite3* on thread local storage and only use that pointer on the thread it was created on. This is how I interpreted the documentation. Is that

Re: [sqlite] compiled features at runtime? - Re: [sqlite] still struggling with "Database schema has changed" errors

2005-02-04 Thread Kervin L. Pierre
Jeff Thompson wrote: The way THREADSAFE works currently, is that it must be defined, but also must have a value assigned to it. The compiler switch /D THREADSAFE won't cause sqlite to have thread safe code included, whiel /D THREADSAFE=1 will. Ensure you're using the latter format, or That was at

Re: [sqlite] still struggling with "Database schema has changed" errors

2005-02-04 Thread Kervin L. Pierre
: http://www.sqlite.org/faq.html#q17 --- "Kervin L. Pierre" <[EMAIL PROTECTED]> wrote: Hi, Thanks for your response. I'm at wit's end with this thing. I do open the database multiple times, but exactly once per thread. I then keep the sqlite3* on thread local storage and only

[sqlite] Concurrency tutorial ( small bounty )

2005-03-25 Thread Kervin L. Pierre
Hello, I've been pulling my hair out over concurrency problems with SQLite 3. SQLITE_BUSY, SQLITE_SCHEMA, SQLITE_MISUSE, I get them all. Over the last few weeks, I've been strictly debugging SQLite problems in my application [ http://openconnector.org ]. No program logic besides fixing ( and

[sqlite] nested transactions?

2005-03-31 Thread Kervin L. Pierre
Hello again, Are there plans for supporting nested transactions in the future? Would that be a difficult extension to code ( eg. if one thought they could give it a try :) ) The current restriction makes it hard to use SQLite in developing a API eg exposed_func1() { sqlite3_exec("BEGIN");

Re: [sqlite] nested transactions?

2005-03-31 Thread Kervin L. Pierre
D. Richard Hipp wrote: On Thu, 2005-03-31 at 17:08 -0500, Kervin L. Pierre wrote: Are there plans for supporting nested transactions in the future? No. Shucks. :) Instead of calling sqlite3_exec("BEGIN") and sqlite3_exec("END") directly, put them in a wrapper function th

[sqlite] idea: sqlite3_begin() and sqlite3_end() ?

2005-03-31 Thread Kervin L. Pierre
Hello, [ Sorry for the second email, but I wanted to separate this ] Would a... sqlite3_begin(sqlite3 *db, int type) sqlite3_end( sqlite3 *db ) be helpful for people counting transactions in a thread environment? The only difference to doing the 'transaction level' counting yourself is that

Re: [sqlite] idea: sqlite3_begin() and sqlite3_end() ?

2005-04-01 Thread Kervin L. Pierre
Hello, These functions are not supposed to be replace nested transactions. They just use the tools the API *already* has to make it easier to work with transactions in recursive and inter-dependent functions/methods. sqlite3_rollback() would rollback the transaction. It does nothing else. By you

[sqlite] most stable/supported C++ wrapper library?

2005-04-01 Thread Kervin L. Pierre
In users experience, what is the most stable, supported LGPL ( or free'er ) SQLite wrapper library out there? I've seen http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers LiteSQL seems like the strongest contender. http://litesql.sourceforge.net/ Any preferences? Input? Thanks, Kervin

Re: [sqlite] idea: sqlite3_begin() and sqlite3_end() ?

2005-04-01 Thread Kervin L. Pierre
John LeSueur wrote: Maybe it's the principle of least surprise. As a new developer, coming to sqlite, if there was this reference counting and loosely emulated nested transactions, and one day I made a mistake and called sqlite3_begin() twice and calling sqlite3_end() just once, nothing would be

Re: [sqlite] Re: using triggers to lock records

2005-04-07 Thread Kervin L. Pierre
Will Leshner wrote: On Apr 6, 2005 10:43 AM, Will Leshner <[EMAIL PROTECTED]> wrote: After thinking about this a bit more, I realized that writing a trigger that didn't trigger for the locker is pretty simple. So I'm thinking that triggers would work in this situation, but I'm wondering if anybody

Re: [sqlite] create table question

2005-04-10 Thread Kervin L. Pierre
Ken & Deb Allen wrote: So, would this problem still exist if the code were to open two 'connections' to the database, issue the SELECT on one open connection and then issue the CREATE TABLE via the other open connection? I'm new to this to, but I think it depends on if that 'db.execute()'

Re: [sqlite] multi_thread for writing

2005-04-16 Thread Kervin L. Pierre
As far as I know, SQLite does not support multiple simultaneous writers. I believe you need to be ready to handle SQLITE_BUSY and SQLITE_SCHEMA errors on every call in a multi- threaded application. SQLITE_BUSY... http://www.sqlite.org/cvstrac/wiki?p=MultiThreading SQLITE_SCHEMA...

Re: [sqlite] Locking Methods

2005-04-19 Thread Kervin L. Pierre
I think that's an excellent idea, and I'd like to help however possible if work starts on a patch. My wishlist 1. Finer grain locking ( Row/table ) 2. Memory resident resultsets 3. Reduction or elimination SQLITE_SCHEMA I think memory resident resultsets would be an excellent feature to start

Re: [sqlite] Locking Methods

2005-04-20 Thread Kervin L. Pierre
That's part of the problem I had been having... 1) You have to loop through the resultset twice, once to put it in memory, the other to process it in your application. 2) The sqlite3_prepare() and sqlite3_finalize() both should be in a loop as well right? Since they can throw SQLITE_BUSY and

Re: [sqlite] sqlite wrapper to prevent locking

2005-04-21 Thread Kervin L. Pierre
Ben Clewett wrote: I do not unfortunately have any place to host this work. There may be somebody on this list who knows of a place where this can be published for any members who may with make use of it. http://sourceforge.net/ ?