Closed
Bug 291991
Opened 20 years ago
Closed 16 years ago
update storage to check if a statement needs to be recreated, to avoid SQLITE_SCHEMA
Categories
(Core :: SQLite and Embedded Database Bindings, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: vlad, Unassigned)
Details
Attachments
(1 file)
|
9.04 KB,
patch
|
Details | Diff | Splinter Review |
Patch attached; new sqlite3 function should be going into core SQLite at some point as well.
| Reporter | ||
Comment 1•20 years ago
|
||
Attachment #181899 -
Flags: first-review?(shaver)
Comment 2•20 years ago
|
||
Comment on attachment 181899 [details] [diff] [review] storage-stmt-fix-0.patch >+ if (mExecuting == PR_FALSE) { (Checking against == PR_FALSE specifically seems awkward, but if that's the style you prefer to |if (!mExecuting)|, it's your code!) > } else if (srv == SQLITE_ERROR) { > // so we may end up with a SQLITE_SCHEMA only after >- // we finalize, because SQLite's error reporting story >+ // we reset, because SQLite's error reporting story > // sucks. > if (mExecuting == PR_TRUE) { >+ PR_LOG(gStorageLog, PR_LOG_ERROR, ("SQLITE_SCHEMA after mExecuting was true!")); >+ > mExecuting = PR_FALSE; > return NS_ERROR_FAILURE; It doesn't look like this block has to do with SQLITE_SCHEMA (the one before it would be entered instead), so the comment and PR_LOG message seem misleading. Should those be SQLITE_ERROR instead? >+nsresult >+mozStorageStatement::Recreate() >+{ >+ nsresult rv; >+ sqlite3_stmt *savedStmt = mDBStatement; >+ mDBStatement = nsnull; >+ rv = Initialize(mDBConnection, mStatementString); >+ NS_ENSURE_SUCCESS(rv, rv); >+ >+ // copy over the param bindings >+ sqlite3_transfer_bindings(savedStmt, mDBStatement); If this fails, do we want to just keep going? I think we'd want to return an error to the caller, which would trickle out for the mozStorage consumer to handle. Does one of those cases (the VDBE_MAGIC_RUN test?) catch us if the database has been DETACHed? r=shaver with error checking of transfer_bindings, at least, and probably the SCHEMA->ERROR changes.
Attachment #181899 -
Flags: first-review?(shaver) → first-review+
Comment 3•20 years ago
|
||
Is this the same as bug 291335? Will that be fixed with this?
| Reporter | ||
Updated•18 years ago
|
Assignee: vladimir → nobody
Updated•17 years ago
|
QA Contact: nobody → storage
Comment 4•16 years ago
|
||
Turns out we don't have to worry about this anymore
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Updated•13 days ago
|
Product: Toolkit → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•