[sqlite] Unexpected behavior with an attached read-only database and BEGIN IMMEDIATE.

2011-11-24 Thread Peter Aronson
BEGIN IMMEDIATE fails when there is a read-only database attached. I'm not saying this is a bug, but it is unexpected behavior and at least mildly inconvenient. Consider the situation where I've opened one database read-write and attach another read-only: sqlite> attach database

Re: [sqlite] Checking for existence of in-memory tables

2011-11-24 Thread Peter Aronson
Each SQLite database has its own sqlite_master table. If open the :memory: database its sqlite_master table can be accessed as sqlite_master or main.sqlite_master. If you attach it, say, using: Attach database ':memory:' as memory; Then the :memory: database's sqlite_master be accessed with

Re: [sqlite] Is this a bug? Can't tell from docs....

2011-11-18 Thread Peter Aronson
Actually, it is documented, on the CREATE TABLE page, near the bottom, in the section titled "ROWIDs and the INTEGER PRIMARY KEY". Not that this is an exactly obvious place to look for it... Best regards, Peter > -Original Message- > From: sqlite-users-boun...@sqlite.org

[sqlite] Minor inconsistency between sqlite3_value_numeric_type() and sqlite3_value_double(), etc.

2011-10-28 Thread Peter Aronson
Not that this is a big difference, but I noticed when looking at the code for sqlite3_value_numeric_type() that it checks for numeric types in text values, but not in blobs values, but that sqlite3_value_double(), sqlite3_value_int() and sqlite3_value_int64() appear to look for numeric strings

Re: [sqlite] Error messages from user-defined functions calling sqlite3_result_error() requires sqlite3_finalize?

2011-10-26 Thread Peter Aronson
Oh, that *is* funny. Peter > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Jean-Christophe Deschamps > Sent: Wednesday, October 26, 2011 6:12 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Error

[sqlite] Error messages from user-defined functions calling sqlite3_result_error() requires sqlite3_finalize?

2011-10-26 Thread Peter Aronson
This may be a known thing, but I can't find anything on it on-line.  I finally figured out a solution by examining the code to shell.c. OK, I have a user-defined function in an extension that calls sqlite3_result_error() when an out-of-bounds argument is passed in.  I called

Re: [sqlite] Concurrent readonly access to a large database.

2011-10-22 Thread Peter Aronson
The default threading mode for SQLite can be Serialized, which means only one thread at a time. See http://www.sqlite.org/threadsafe.html However, you can change it to Multithreaded either at compile time or via a call to sqlite3_config() (that's in the C API -- I don't know about Python, but

[sqlite] Doc bug in on-line description of round() function

2011-10-20 Thread Peter Aronson
Here's where I let my pedantic side out to play.  The documentation for the round() function on the SQLite website at http://www.sqlite.org/lang_corefunc.html says: "The round(X,Y) function returns a string representation of the floating-point value X rounded to Y digits to the right of the

Re: [sqlite] Is there a better way to get this information other than modifying SQLite?

2011-10-20 Thread Peter Aronson
Roger, > Out of curiousity why do you want to know this?  Note that even if a > database is opened at the SQLite level readonly it can still be written to > at the operating system level - an example would be recovering from the > journal. I'm porting code from DBMS platforms that have grants

[sqlite] Is there a better way to get this information other than modifying SQLite?

2011-10-20 Thread Peter Aronson
In the course of porting some software to use SQLite, I found I have needed some information that I could not figure out how to get from SQLite without undo effort, but that SQLite actually "knows".  The first is whether a database currently attached to the database connection was open

[sqlite] Unexpected behavior when renaming a virtual table (rtree) in a UTF-16 database

2011-10-18 Thread Peter Aronson
This behavior seems to happen in both stock standard 3.7.7.1 on 32-bit Windows XP and my customized 3.7.8 on Solaris 9 (Sparc).  Here's the capture from Windows: D:\peter\sqlite-shell-win32-x86-3070701>sqlite3 this_is_a_new_db.db SQLite version 3.7.7.1 2011-06-28 17:39:05 Enter ".help" for

<    1   2