On 11/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
* You never get an SQLITE_SCHEMA error. sqlite3_prepare_v2 retains the original SQL and automatically reprepares and rebinds it following a schema change.
Does this part of the change require a new API at all?
* sqlite3_step() returns the correct error code right away, rather than just returning SQLITE_ERROR and making you call sqlite3_reset() to find the true reason for the error.
I've been thinking a way to work around this would be to turn on extended error reporting, and stuff the SQLITE_SCHEMA error up there. It's still a wart, but not so complicated as now. Alternately, there could be a config setting on the order of "return SQLITE_SCHEMA from sqlite3_step()" which people could call to indicate what they prefer. Obviously, neither of those options gets to a world where the default expectation becomes the basic error-handling. But at this point, it's going to be confusing no matter what, even with sqlite3_prepare_v2(), the sqlite3_step() documentation has to clarify that you could get different sets of error codes depending on how you prepared the statement.
QUESTION 1: sqlite3_prepare_v2 is the merely the working name for the new function. What should the official name be?
If the answers above were "No" and "That would work", then no new name would be required... [I should note that I don't care if there's a new name, I'm just being contrary!]
QUESTION 3: Suppose there is a schema change and the SQL statement is automatically reprepared. But the schema change is such that the SQL is no longer valid. (Perhaps one of the tables mentioned in a SELECT statement was dropped.) What error code should sqlite3_step() return in that case?
It would be interesting if there were fine-grained locks on the schema, which would cause the schema change itself to error out if any prepared statement would be broken. Probably impossible in light of multiple database connections, though. -scott ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------