mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
When logging errors using sqlite3_log() and the error text includes the
text of an SQL statement, but the SQL statement text at the end so that if the error message buffer overflows it is the SQL statement text that gets truncated, not the statement of the problem. FossilOrigin-Name: de0968226effb79f9d25539da7882fa5475e4ff2410870b45a63a6545deb5979
This commit is contained in:
@@ -1318,7 +1318,7 @@ case OP_Halt: {
|
||||
sqlite3VdbeError(p, "%s", pOp->p4.z);
|
||||
}
|
||||
pcx = (int)(pOp - aOp);
|
||||
sqlite3_log(pOp->p1, "abort at %d in [%s]: %s", pcx, p->zSql, p->zErrMsg);
|
||||
sqlite3_log(pOp->p1, "abort at %d: %s; [%s]", pcx, p->zErrMsg, p->zSql);
|
||||
}
|
||||
rc = sqlite3VdbeHalt(p);
|
||||
assert( rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR );
|
||||
@@ -9153,8 +9153,8 @@ abort_due_to_error:
|
||||
p->rc = rc;
|
||||
sqlite3SystemError(db, rc);
|
||||
testcase( sqlite3GlobalConfig.xLog!=0 );
|
||||
sqlite3_log(rc, "statement aborts at %d: [%s] %s",
|
||||
(int)(pOp - aOp), p->zSql, p->zErrMsg);
|
||||
sqlite3_log(rc, "statement aborts at %d: %s; [%s]",
|
||||
(int)(pOp - aOp), p->zErrMsg, p->zSql);
|
||||
if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p);
|
||||
if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db);
|
||||
if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){
|
||||
|
Reference in New Issue
Block a user