diff options
author | drh <> | 2025-04-17 17:46:28 +0000 |
---|---|---|
committer | drh <> | 2025-04-17 17:46:28 +0000 |
commit | 56747d184053e586848b22cce94fa8e0efa6f1aa (patch) | |
tree | 9d1da6f4effc1df53d40c232d997bbe4d5bb3136 /src | |
parent | 680a9584c6eaa98e16d682f0e0bd57f4abc36350 (diff) | |
download | sqlite-56747d184053e586848b22cce94fa8e0efa6f1aa.tar.gz sqlite-56747d184053e586848b22cce94fa8e0efa6f1aa.zip |
Increase the size of the output buffer for sqlite3_log().
FossilOrigin-Name: a64e8491c9863f890daa9f5d8f678728dc0d00bc1f3c238b50214ec545450fcf
Diffstat (limited to 'src')
-rw-r--r-- | src/printf.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/printf.c b/src/printf.c index 166c11194..8cb5a43c5 100644 --- a/src/printf.c +++ b/src/printf.c @@ -1344,6 +1344,15 @@ char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ return zBuf; } +/* Maximum size of an sqlite3_log() message. */ +#if defined(SQLITE_MAX_LOG_MESSAGE) + /* Leave the definition as supplied */ +#elif SQLITE_PRINT_BUF_SIZE*10>10000 +# define SQLITE_MAX_LOG_MESSAGE 10000 +#else +# define SQLITE_MAX_LOG_MESSAGE (SQLITE_PRINT_BUF_SIZE*10) +#endif + /* ** This is the routine that actually formats the sqlite3_log() message. ** We house it in a separate routine from sqlite3_log() to avoid using @@ -1360,7 +1369,7 @@ char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ */ static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){ StrAccum acc; /* String accumulator */ - char zMsg[SQLITE_PRINT_BUF_SIZE*3]; /* Complete log message */ + char zMsg[SQLITE_MAX_LOG_MESSAGE]; /* Complete log message */ sqlite3StrAccumInit(&acc, 0, zMsg, sizeof(zMsg), 0); sqlite3_str_vappendf(&acc, zFormat, ap); |