1
0
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:
drh
2025-04-17 19:01:54 +00:00
parent 56747d1840
commit 10744c61ad
3 changed files with 10 additions and 10 deletions

View File

@@ -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 ){