1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Rewrite the (debugging use only) sqlite3VdbeMemPrettyPrint() function to use

the safer StrAccum interface rather than writing directly into a static string
buffer.  Perhaps this will address ticket [bbd55a97e66ff50d], which we are
unable to reproduce.

FossilOrigin-Name: 69f6a7e42f42116d29514239575ee1dc381b5b673da012cb5f3e8cf17922d493
This commit is contained in:
drh
2020-01-06 19:23:41 +00:00
parent 2e26a602a3
commit 5ca06329c9
5 changed files with 41 additions and 56 deletions

View File

@@ -215,9 +215,11 @@ SQLITE_NOINLINE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
{
char zBuf[100];
sqlite3VdbeMemPrettyPrint(pMem, zBuf);
fprintf(stderr, "INPUT: %s\n", zBuf);
StrAccum acc;
char zBuf[1000];
sqlite3StrAccumInit(&acc, 0, zBuf, sizeof(zBuf), 0);
sqlite3VdbeMemPrettyPrint(pMem, &acc);
fprintf(stderr, "INPUT: %s\n", sqlite3StrAccumFinish(&acc));
}
#endif
@@ -325,9 +327,11 @@ SQLITE_NOINLINE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
translate_out:
#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
{
char zBuf[100];
sqlite3VdbeMemPrettyPrint(pMem, zBuf);
fprintf(stderr, "OUTPUT: %s\n", zBuf);
StrAccum acc;
char zBuf[1000];
sqlite3StrAccumInit(&acc, 0, zBuf, sizeof(zBuf), 0);
sqlite3VdbeMemPrettyPrint(pMem, &acc);
fprintf(stderr, "OUTPUT: %s\n", sqlite3StrAccumFinish(&acc));
}
#endif
return SQLITE_OK;