diff options
author | drh <> | 2025-04-17 19:01:54 +0000 |
---|---|---|
committer | drh <> | 2025-04-17 19:01:54 +0000 |
commit | 10744c61adc1a3136086fee4f34a89e5fb94bd1e (patch) | |
tree | 75765d2d64b80357a07a8a21b2d9f4cdaae66da4 /src | |
parent | 56747d184053e586848b22cce94fa8e0efa6f1aa (diff) | |
download | sqlite-10744c61adc1a3136086fee4f34a89e5fb94bd1e.tar.gz sqlite-10744c61adc1a3136086fee4f34a89e5fb94bd1e.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 6ded15c79..d4009b70f 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -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 ){ |