/ Check-in [578da247]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 578da2476e356ea35d272e18faf490efedeaf25c
User & Date: drh 2007-08-13 11:10:35
Context
2007-08-13
12:39
Add a new test cases for a problem with malloc failure during the parsing of CREATE TABLE statements in autovacuum mode. (CVS 4211) check-in: be50387e user: drh tags: trunk
11:10
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) check-in: 578da247 user: drh tags: trunk
2007-08-12
20:07
Updates to test scripts for better support of soft-heap-limit testing. (CVS 4209) check-in: 990f621f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to src/vdbeaux.c.

789
790
791
792
793
794
795
796
797


798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
void sqlite3VdbeIOTraceSql(Vdbe *p){
  int nOp = p->nOp;
  VdbeOp *pOp;
  if( sqlite3_io_trace==0 ) return;
  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;


    for(i=0; isspace((unsigned char)z[i]); i++){}
    for(j=0; z[i]; i++){
      if( isspace((unsigned char)z[i]) ){
        if( z[i-1]!=' ' ){
          z[j++] = ' ';
        }
      }else{
        z[j++] = z[i];
      }
    }
    z[j] = 0;
    sqlite3_io_trace("SQL %s\n", z);
    sqliteFree(z);
  }
}
#endif /* !SQLITE_OMIT_TRACE && SQLITE_ENABLE_IOTRACE */


/*
** Prepare a virtual machine for execution.  This involves things such







<

>
>












<







789
790
791
792
793
794
795

796
797
798
799
800
801
802
803
804
805
806
807
808
809
810

811
812
813
814
815
816
817
void sqlite3VdbeIOTraceSql(Vdbe *p){
  int nOp = p->nOp;
  VdbeOp *pOp;
  if( sqlite3_io_trace==0 ) return;
  if( nOp<1 ) return;
  pOp = &p->aOp[nOp-1];
  if( pOp->opcode==OP_Noop && pOp->p3!=0 ){

    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]) ){
        if( z[i-1]!=' ' ){
          z[j++] = ' ';
        }
      }else{
        z[j++] = z[i];
      }
    }
    z[j] = 0;
    sqlite3_io_trace("SQL %s\n", z);

  }
}
#endif /* !SQLITE_OMIT_TRACE && SQLITE_ENABLE_IOTRACE */


/*
** Prepare a virtual machine for execution.  This involves things such