Remove a memory allocation from sqlite3VdbeIOTraceSql(). This means that

when doing I/O tracing, the text of an SQL statement is truncated to the
first 1000 characters.  But it also means tracing works in an out-of-memory
situation. (CVS 4210)

FossilOrigin-Name: 578da2476e356ea35d272e18faf490efedeaf25c
This commit is contained in:
drh
2007-08-13 11:10:34 +00:00
parent 3aefabaf94
commit 00a18e476a
3 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -793,8 +793,9 @@ void sqlite3VdbeIOTraceSql(Vdbe *p){
if( nOp<1 ) return;
pOp = &p->aOp[nOp-1];
if( pOp->opcode==OP_Noop && pOp->p3!=0 ){
char *z = sqlite3StrDup(pOp->p3);
int i, j;
char z[1000];
sqlite3_snprintf(sizeof(z), z, "%s", pOp->p3);
for(i=0; isspace((unsigned char)z[i]); i++){}
for(j=0; z[i]; i++){
if( isspace((unsigned char)z[i]) ){
@@ -807,7 +808,6 @@ void sqlite3VdbeIOTraceSql(Vdbe *p){
}
z[j] = 0;
sqlite3_io_trace("SQL %s\n", z);
sqliteFree(z);
}
}
#endif /* !SQLITE_OMIT_TRACE && SQLITE_ENABLE_IOTRACE */