1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Continuing improvements to error reporting and the sqlite3_log() routine.

FossilOrigin-Name: edea3bb740ddd096a46e00678b59d465bb1e2903
This commit is contained in:
drh
2010-02-23 20:11:56 +00:00
parent 39547b418b
commit 413c3d36a2
15 changed files with 161 additions and 94 deletions

View File

@@ -847,7 +847,9 @@ case OP_Halt: {
p->errorAction = (u8)pOp->p2;
p->pc = pc;
if( pOp->p4.z ){
assert( p->rc!=SQLITE_OK );
sqlite3SetString(&p->zErrMsg, db, "%s", pOp->p4.z);
sqlite3_log(pOp->p1, "abort at %d in [%s]: %s", pc, p->zSql, pOp->p4.z);
}
rc = sqlite3VdbeHalt(p);
assert( rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR );
@@ -5697,6 +5699,7 @@ default: { /* This is really OP_Noop and OP_Explain */
vdbe_error_halt:
assert( rc );
p->rc = rc;
sqlite3_log(rc, "prepared statement aborts at %d: [%s]", pc, p->zSql);
sqlite3VdbeHalt(p);
if( rc==SQLITE_IOERR_NOMEM ) db->mallocFailed = 1;
rc = SQLITE_ERROR;
@@ -5725,12 +5728,6 @@ no_mem:
rc = SQLITE_NOMEM;
goto vdbe_error_halt;
/* Jump to here for an SQLITE_MISUSE error.
*/
abort_due_to_misuse:
rc = SQLITE_MISUSE;
/* Fall thru into abort_due_to_error */
/* Jump to here for any other kind of fatal error. The "rc" variable
** should hold the error number.
*/