SQLite4
Check-in [7091e990cd]
Not logged in

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

Overview
Comment:Remove sqlite4_mem_methods from sqlite.h.in. Other modifications so that src4.test works again.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7091e990cdf45e0ea8c1dabda4db745b75d50cbb
User & Date: dan 2013-05-21 20:08:24
Context
2013-05-22
17:40
Add simple OOM injection test to show that the sqlite4_mm based test infrastructure works. check-in: 3f1a52c793 user: dan tags: trunk
2013-05-21
20:08
Remove sqlite4_mem_methods from sqlite.h.in. Other modifications so that src4.test works again. check-in: 7091e990cd user: dan tags: trunk
18:19
Re-enable memory statistics and backtraces. check-in: 75b8ccc0a8 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to main.mk.

    73     73            callback.o complete.o ctime.o date.o delete.o env.o expr.o \
    74     74            fault.o fkey.o fts5.o fts5func.o \
    75     75            func.o global.o hash.o \
    76     76            icu.o insert.o kv.o kvlsm.o kvmem.o legacy.o \
    77     77            lsm_ckpt.o lsm_file.o lsm_log.o lsm_main.o lsm_mem.o lsm_mutex.o \
    78     78            lsm_shared.o lsm_str.o lsm_sorted.o lsm_tree.o \
    79     79            lsm_unix.o lsm_varint.o \
    80         -         main.o malloc.o math.o mem.o mem0.o mem1.o mem2.o mem3.o mem5.o \
           80  +         main.o malloc.o math.o mem.o mem0.o mem2.o mem3.o mem5.o \
    81     81            mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
    82     82            opcodes.o os.o \
    83     83            pragma.o prepare.o printf.o \
    84     84            random.o resolve.o rowset.o rtree.o select.o status.o \
    85     85            tokenize.o trigger.o \
    86     86            update.o util.o varint.o \
    87     87            vdbeapi.o vdbeaux.o vdbecodec.o vdbecursor.o \
................................................................................
   133    133     $(TOP)/src/lsm_unix.c \
   134    134     $(TOP)/src/lsm_varint.c \
   135    135     $(TOP)/src/main.c \
   136    136     $(TOP)/src/malloc.c \
   137    137     $(TOP)/src/math.c \
   138    138     $(TOP)/src/mem.c \
   139    139     $(TOP)/src/mem0.c \
   140         -  $(TOP)/src/mem1.c \
   141    140     $(TOP)/src/mem2.c \
   142    141     $(TOP)/src/mem3.c \
   143    142     $(TOP)/src/mem5.c \
   144    143     $(TOP)/src/mutex.c \
   145    144     $(TOP)/src/mutex.h \
   146    145     $(TOP)/src/mutex_noop.c \
   147    146     $(TOP)/src/mutex_unix.c \

Changes to src/env.c.

    41     41      SQLITE4_DEFAULT_MEMSTATUS, /* bMemstat */
    42     42      1,                         /* bCoreMutex */
    43     43      SQLITE4_THREADSAFE==1,     /* bFullMutex */
    44     44      0x7ffffffe,                /* mxStrlen */
    45     45      0,                         /* szLookaside */
    46     46      0,                         /* nLookaside */
    47     47      &sqlite4MMSystem,          /* pMM */
    48         -#if 0
    49         -   {0,0,0,0,0,0,0,0,0},       /* m */
    50         -#endif
    51     48      {0,0,0,0,0,0,0,0,0,0},     /* mutex */
    52     49      (void*)0,                  /* pHeap */
    53     50      0,                         /* nHeap */
    54     51      0, 0,                      /* mnHeap, mxHeap */
    55     52      0,                         /* mxParserStack */
    56     53      &sqlite4BuiltinFactory,    /* pFactory */
    57     54      sqlite4OsRandomness,       /* xRandomness */

Changes to src/sqlite.h.in.

   729    729   /*
   730    730   ** CAPIREF: Run-time environment of a database connection
   731    731   **
   732    732   ** Return the sqlite4_env object to which the database connection
   733    733   ** belongs.
   734    734   */
   735    735   sqlite4_env *sqlite4_db_env(sqlite4*);
   736         -
   737         -/*
   738         -** CAPIREF: Memory Allocation Routines
   739         -**
   740         -** An instance of this object defines the interface between SQLite
   741         -** and low-level memory allocation routines.
   742         -**
   743         -** This object is used in only one place in the SQLite interface.
   744         -** A pointer to an instance of this object is the argument to
   745         -** [sqlite4_env_config()] when the configuration option is
   746         -** [SQLITE4_ENVCONFIG_MALLOC] or [SQLITE4_ENVCONFIG_GETMALLOC].  
   747         -** By creating an instance of this object
   748         -** and passing it to [sqlite4_env_config]([SQLITE4_ENVCONFIG_MALLOC])
   749         -** during configuration, an application can specify an alternative
   750         -** memory allocation subsystem for SQLite to use for all of its
   751         -** dynamic memory needs.
   752         -**
   753         -** Note that SQLite comes with several [built-in memory allocators]
   754         -** that are perfectly adequate for the overwhelming majority of applications
   755         -** and that this object is only useful to a tiny minority of applications
   756         -** with specialized memory allocation requirements.  This object is
   757         -** also used during testing of SQLite in order to specify an alternative
   758         -** memory allocator that simulates memory out-of-memory conditions in
   759         -** order to verify that SQLite recovers gracefully from such
   760         -** conditions.
   761         -**
   762         -** The xMalloc, xRealloc, and xFree methods must work like the
   763         -** malloc(), realloc() and free() functions from the standard C library.
   764         -** ^SQLite guarantees that the second argument to
   765         -** xRealloc is always a value returned by a prior call to xRoundup.
   766         -**
   767         -** xSize should return the allocated size of a memory allocation
   768         -** previously obtained from xMalloc or xRealloc.  The allocated size
   769         -** is always at least as big as the requested size but may be larger.
   770         -**
   771         -** The xRoundup method returns what would be the allocated size of
   772         -** a memory allocation given a particular requested size.  Most memory
   773         -** allocators round up memory allocations at least to the next multiple
   774         -** of 8.  Some allocators round up to a larger multiple or to a power of 2.
   775         -** Every memory allocation request coming in through [sqlite4_malloc()]
   776         -** or [sqlite4_realloc()] first calls xRoundup.  If xRoundup returns 0, 
   777         -** that causes the corresponding memory allocation to fail.
   778         -**
   779         -** The xInit method initializes the memory allocator.  (For example,
   780         -** it might allocate any require mutexes or initialize internal data
   781         -** structures.  The xShutdown method is invoked (indirectly) by
   782         -** [sqlite4_shutdown()] and should deallocate any resources acquired
   783         -** by xInit.  The pMemEnv pointer is used as the only parameter to
   784         -** xInit and xShutdown.
   785         -**
   786         -** SQLite holds the [SQLITE4_MUTEX_STATIC_MASTER] mutex when it invokes
   787         -** the xInit method, so the xInit method need not be threadsafe.  The
   788         -** xShutdown method is only called from [sqlite4_shutdown()] so it does
   789         -** not need to be threadsafe either.  For all other methods, SQLite
   790         -** holds the [SQLITE4_MUTEX_STATIC_MEM] mutex as long as the
   791         -** [SQLITE4_CONFIG_MEMSTATUS] configuration option is turned on (which
   792         -** it is by default) and so the methods are automatically serialized.
   793         -** However, if [SQLITE4_CONFIG_MEMSTATUS] is disabled, then the other
   794         -** methods must be threadsafe or else make their own arrangements for
   795         -** serialization.
   796         -**
   797         -** SQLite will never invoke xInit() more than once without an intervening
   798         -** call to xShutdown().
   799         -*/
   800         -typedef struct sqlite4_mem_methods sqlite4_mem_methods;
   801         -struct sqlite4_mem_methods {
   802         -  void *(*xMalloc)(void*,sqlite4_size_t); /* Memory allocation function */
   803         -  void (*xFree)(void*,void*);             /* Free a prior allocation */
   804         -  void *(*xRealloc)(void*,void*,int);     /* Resize an allocation */
   805         -  sqlite4_size_t (*xSize)(void*,void*);   /* Return the size of an allocation */
   806         -  int (*xInit)(void*);                    /* Initialize the memory allocator */
   807         -  void (*xShutdown)(void*);               /* Deinitialize the allocator */
   808         -  void (*xBeginBenign)(void*);            /* Enter a benign malloc region */
   809         -  void (*xEndBenign)(void*);              /* Leave a benign malloc region */
   810         -  void *pMemEnv;                         /* 1st argument to all routines */
   811         -};
   812         -
   813    736   
   814    737   /*
   815    738   ** CAPIREF: Database Connection Configuration Options
   816    739   **
   817    740   ** These constants are the available integer configuration options that
   818    741   ** can be passed as the second argument to the [sqlite4_db_config()] interface.
   819    742   **

Changes to src/sqliteInt.h.

  2406   2406     int bMemstat;                     /* True to enable memory status */
  2407   2407     int bCoreMutex;                   /* True to enable core mutexing */
  2408   2408     int bFullMutex;                   /* True to enable full mutexing */
  2409   2409     int mxStrlen;                     /* Maximum string length */
  2410   2410     int szLookaside;                  /* Default lookaside buffer size */
  2411   2411     int nLookaside;                   /* Default lookaside buffer count */
  2412   2412     sqlite4_mm *pMM;                  /* Memory allocator for this environment */
  2413         -#if 0
  2414         -  sqlite4_mem_methods m;            /* Low-level memory allocation interface */
  2415         -#endif
  2416   2413     sqlite4_mutex_methods mutex;      /* Low-level mutex interface */
  2417   2414     void *pHeap;                      /* Heap storage space */
  2418   2415     int nHeap;                        /* Size of pHeap[] */
  2419   2416     int mnReq, mxReq;                 /* Min and max heap requests sizes */
  2420   2417     int mxParserStack;                /* maximum depth of the parser stack */
  2421   2418     KVFactory *pFactory;              /* List of factories */
  2422   2419     int (*xRandomness)(sqlite4_env*, int, unsigned char*);

Changes to src/update.c.

   262    262     hasFK = sqlite4FkRequired(pParse, pTab, aXRef);
   263    263   
   264    264     /* Allocate memory for the array aRegIdx[].  There is one entry in the
   265    265     ** array for each index associated with table being updated.  Fill in
   266    266     ** the value with a register number for indices that are to be used
   267    267     ** and with zero for unused indices.  */
   268    268     for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){}
   269         -  aRegIdx = sqlite4DbMallocZero(db, sizeof(Index*) * nIdx );
   270         -  if( aRegIdx==0 ) goto update_cleanup;
          269  +  assert( nIdx>0 || isView );
          270  +  if( nIdx ){
          271  +    aRegIdx = sqlite4DbMallocZero(db, sizeof(Index*) * nIdx );
          272  +    if( aRegIdx==0 ) goto update_cleanup;
          273  +  }
   271    274   
   272    275     /* Allocate registers for and populate the aRegIdx array. */
   273    276     for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
   274    277       if( pIdx==pPk || hasFK || bChngPk ){
   275    278         aRegIdx[j] = ++pParse->nMem;
   276    279       }else{
   277    280         for(i=0; i<pIdx->nColumn; i++){

Changes to test/auth.test.

  2208   2208         INSERT INTO v1chng VALUES(OLD.x,NEW.x);
  2209   2209       END;
  2210   2210       SELECT * FROM v1;
  2211   2211     }
  2212   2212   } {115 117}
  2213   2213   do_test auth-4.3 {
  2214   2214     set authargs {}
         2215  +  breakpoint
  2215   2216     execsql {
  2216   2217       UPDATE v1 SET x=1 WHERE x=117
  2217   2218     }
  2218   2219     set authargs
  2219   2220   } [list \
  2220   2221     SQLITE4_UPDATE v1     x  main {} \
  2221   2222     SQLITE4_SELECT {}     {} {}   v1 \

Changes to test/fts5snippet.test.

   116    116     1 utf16
   117    117   } {
   118    118   if {$DO_MALLOC_TEST || $enc=="utf16"} continue
   119    119   
   120    120     db close
   121    121     forcedelete test.db
   122    122     sqlite4 db test.db
   123         -  sqlite4_db_config_lookaside db 0 0 0
   124    123     db eval "PRAGMA encoding = \"$enc\""
   125    124   
   126    125     # Set variable $T to the test name prefix for this iteration of the loop.
   127    126     #
   128    127     set T "fts5snippet-$enc"
   129    128     
   130    129     ##########################################################################

Changes to test/malloc_common.tcl.

   154    154   #   faultsim_delete_and_reopen
   155    155   #
   156    156   proc faultsim_save {args} { uplevel db_save $args }
   157    157   proc faultsim_save_and_close {args} { uplevel db_save_and_close $args }
   158    158   proc faultsim_restore {args} { uplevel db_restore $args }
   159    159   proc faultsim_restore_and_reopen {args} { 
   160    160     uplevel db_restore_and_reopen $args 
   161         -  sqlite4_db_config_lookaside db 0 0 0
          161  +  #sqlite4_db_config_lookaside db 0 0 0
   162    162   }
   163    163   proc faultsim_delete_and_reopen {args} {
   164    164     uplevel db_delete_and_reopen $args 
   165         -  sqlite4_db_config_lookaside db 0 0 0
          165  +  #sqlite4_db_config_lookaside db 0 0 0
   166    166   }
   167    167   
   168    168   proc faultsim_integrity_check {{db db}} {
   169    169     set ic [$db eval { PRAGMA integrity_check }]
   170    170     if {$ic != "ok"} { error "Integrity check: $ic" }
   171    171   }
   172    172   
................................................................................
   422    422           forcedelete test2.db
   423    423           forcedelete test2.db-journal
   424    424           forcedelete test2.db-wal
   425    425           if {[info exists ::mallocopts(-testdb)]} {
   426    426             copy_file $::mallocopts(-testdb) test.db
   427    427           }
   428    428           catch { sqlite4 db test.db }
   429         -        sqlite4_db_config_lookaside db 0 0 0
          429  +        #sqlite4_db_config_lookaside db 0 0 0
   430    430     
   431    431           # Execute any -tclprep and -sqlprep scripts.
   432    432           #
   433    433           if {[info exists ::mallocopts(-tclprep)]} {
   434    434             eval $::mallocopts(-tclprep)
   435    435           }
   436    436           if {[info exists ::mallocopts(-sqlprep)]} {

Changes to test/test_config.c.

    77     77   
    78     78   #ifdef SQLITE4_DISABLE_LFS
    79     79     Tcl_SetVar2(interp, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY);
    80     80   #else
    81     81     Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY);
    82     82   #endif
    83     83   
    84         -#if 1 /* def SQLITE4_MEMDEBUG */
           84  +#if 0 /* def SQLITE4_MEMDEBUG */
    85     85     Tcl_SetVar2(interp, "sqlite_options", "memdebug", "1", TCL_GLOBAL_ONLY);
    86     86   #else
    87     87     Tcl_SetVar2(interp, "sqlite_options", "memdebug", "0", TCL_GLOBAL_ONLY);
    88     88   #endif
    89     89   
    90     90   #ifdef SQLITE4_ENABLE_8_3_NAMES
    91     91     Tcl_SetVar2(interp, "sqlite_options", "8_3_names", "1", TCL_GLOBAL_ONLY);

Changes to test/test_malloc.c.

    17     17   #include "tcl.h"
    18     18   #include <stdlib.h>
    19     19   #include <string.h>
    20     20   #include <assert.h>
    21     21   
    22     22   #include "testInt.h"
    23     23   
           24  +#if 0 
    24     25   /*
    25     26   ** This structure is used to encapsulate the global state variables used 
    26     27   ** by malloc() fault simulation.
    27     28   */
    28     29   static struct MemFault {
    29     30     int iCountdown;         /* Number of pending successes before a failure */
    30     31     int nRepeat;            /* Number of times to repeat the failure */
................................................................................
   229    230     if( rc==SQLITE4_OK ){
   230    231       memfault.isInstalled = 1;
   231    232     }
   232    233     return rc;
   233    234   #endif
   234    235   }
   235    236   
          237  +#endif
   236    238   #ifdef SQLITE4_TEST
          239  +
          240  +#if 0
   237    241   
   238    242   /*
   239    243   ** This function is implemented in test1.c. Returns a pointer to a static
   240    244   ** buffer containing the symbolic SQLite error code that corresponds to
   241    245   ** the least-significant 8-bits of the integer passed as an argument.
   242    246   ** For example:
   243    247   **
................................................................................
  1120   1124   #ifdef SQLITE4_ENABLE_MEMSYS3
  1121   1125     const sqlite4_mem_methods *sqlite4MemGetMemsys3(void);
  1122   1126     rc = sqlite4_env_config(0, SQLITE4_ENVCONFIG_MALLOC, sqlite4MemGetMemsys3());
  1123   1127   #endif
  1124   1128     Tcl_SetResult(interp, (char *)sqlite4TestErrorName(rc), TCL_VOLATILE);
  1125   1129     return TCL_OK;
  1126   1130   }
         1131  +
         1132  +#endif
  1127   1133   
  1128   1134   static sqlite4_mm *pMMDebug = 0;
  1129   1135   
  1130   1136   /*
  1131   1137   ** tclcmd: test_mm_install ?debug? ?backtrace? ?stats?
  1132   1138   */
  1133   1139   static int test_mm_install(
................................................................................
  1264   1270   */
  1265   1271   int Sqlitetest_malloc_Init(Tcl_Interp *interp){
  1266   1272     static struct {
  1267   1273        char *zName;
  1268   1274        Tcl_ObjCmdProc *xProc;
  1269   1275        int clientData;
  1270   1276     } aObjCmd[] = {
         1277  +#if 0
  1271   1278        { "sqlite4_malloc",                 test_malloc                   ,0 },
  1272   1279        { "sqlite4_realloc",                test_realloc                  ,0 },
  1273   1280        { "sqlite4_free",                   test_free                     ,0 },
  1274   1281        { "memset",                         test_memset                   ,0 },
  1275   1282        { "memget",                         test_memget                   ,0 },
  1276   1283        { "sqlite4_memdebug_backtrace",     test_memdebug_backtrace       ,0 },
  1277   1284        { "sqlite4_memdebug_dump",          test_memdebug_dump            ,0 },
................................................................................
  1284   1291        { "sqlite4_db_status",              test_db_status                ,0 },
  1285   1292        { "install_malloc_faultsim",        test_install_malloc_faultsim  ,0 },
  1286   1293        { "sqlite4_env_config_memstatus",   test_config_memstatus         ,0 },
  1287   1294        { "sqlite4_envconfig_lookaside",    test_envconfig_lookaside      ,0 },
  1288   1295        { "sqlite4_config_error",           test_config_error             ,0 },
  1289   1296        { "sqlite4_db_config_lookaside",    test_db_config_lookaside      ,0 },
  1290   1297        { "sqlite4_install_memsys3",        test_install_memsys3          ,0 },
         1298  +#endif
  1291   1299   
  1292   1300        { "test_mm_install",                test_mm_install               ,0 },
  1293   1301        { "test_mm_stat",                   test_mm_stat                  ,0 },
  1294   1302        { "test_mm_report",                 test_mm_report                ,0 },
  1295   1303     };
  1296   1304     int i;
  1297   1305     for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
  1298   1306       ClientData c = (ClientData)SQLITE4_INT_TO_PTR(aObjCmd[i].clientData);
  1299   1307       Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, c, 0);
  1300   1308     }
  1301   1309     return TCL_OK;
  1302   1310   }
  1303   1311   #endif

Changes to test/tester.tcl.

    81     81   # 64KB into the database file instead of the one 1GB in. This means
    82     82   # the code that handles that special case can be tested without creating
    83     83   # very large database files.
    84     84   #
    85     85   set tcl_precision 15
    86     86   #sqlite4_test_control_pending_byte 0x0010000
    87     87   
    88         -test_mm_install stats debug
    89         -
    90     88   
    91     89   # If the pager codec is available, create a wrapper for the [sqlite4] 
    92     90   # command that appends "-key {xyzzy}" to the command line. i.e. this:
    93     91   #
    94     92   #     sqlite4 db test.db
    95     93   #
    96     94   # becomes
................................................................................
   359    357         default {
   360    358           lappend leftover $a
   361    359         }
   362    360       }
   363    361     }
   364    362     set argv $leftover
   365    363   
   366         -  # Install the malloc layer used to inject OOM errors. And the 'automatic'
   367         -  # extensions. This only needs to be done once for the process.
   368         -  #
          364  +  # Install the various malloc wrappers. This only needs to be done 
          365  +  # once for the process.
   369    366     sqlite4_shutdown 
          367  +  set mm stats
          368  +  if {$cmdlinearg(malloctrace)} { lappend mm debug }
          369  +  test_mm_install {*}$mm
          370  +
          371  +
   370    372     # install_malloc_faultsim 1 
   371         -  if {$cmdlinearg(malloctrace)} { testmem install }
   372    373     kvwrap install
   373         -  sqlite4_initialize
   374    374     #autoinstall_test_functions
          375  +  sqlite4_initialize
   375    376   
   376    377     # If the --binarylog option was specified, create the logging VFS. This
   377    378     # call installs the new VFS as the default for all SQLite connections.
   378    379     #
   379    380     if {$cmdlinearg(binarylog)} {
   380    381       vfslog new binarylog {} vfslog.bin
   381    382     }
................................................................................
   404    405   }
   405    406   reset_db
   406    407   
   407    408   # Abort early if this script has been run before.
   408    409   #
   409    410   if {[info exists TC(count)]} return
   410    411   
   411         -# Make sure memory statistics are enabled.
   412         -#
   413         -sqlite4_env_config_memstatus 1
   414         -
   415    412   # Initialize the test counters and set up commands to access them.
   416    413   # Or, if this is a slave interpreter, set up aliases to write the
   417    414   # counters in the parent interpreter.
   418    415   #
   419    416   if {0==[info exists ::SLAVE]} {
   420    417     set TC(errors)    0
   421    418     set TC(count)     0
................................................................................
   466    463   #
   467    464   proc do_test {name cmd expected} {
   468    465   
   469    466     global argv cmdlinearg
   470    467   
   471    468     fix_testname name
   472    469   
   473         -  sqlite4_memdebug_settitle $name
          470  +  #sqlite4_memdebug_settitle $name
   474    471   
   475    472   #  if {[llength $argv]==0} { 
   476    473   #    set go 1
   477    474   #  } else {
   478    475   #    set go 0
   479    476   #    foreach pattern $argv {
   480    477   #      if {[string match $pattern $name]} {
................................................................................
   770    767     set nUnit [test_mm_stat units]
   771    768     if {$nOut!=0 || $nUnit!=0} {
   772    769       puts "Unfreed memory: $nOut bytes in $nUnit allocations"
   773    770     } else {
   774    771       puts "All memory allocations freed - no leaks"
   775    772     }
   776    773     show_memstats
   777         -  test_mm_report malloc.txt
          774  +  if {$::cmdlinearg(malloctrace)} { 
          775  +    puts "Writing malloc() report to malloc.txt..."
          776  +    test_mm_report malloc.txt
          777  +  }
   778    778   
   779    779   #  if {[lindex [sqlite4_env_status SQLITE4_ENVSTATUS_MALLOC_COUNT 0] 1]>0 ||
   780    780   #              [sqlite4_memory_used]>0} {
   781    781   #    puts "Unfreed memory: [sqlite4_memory_used] bytes in\
   782    782   #         [lindex [sqlite4_env_status SQLITE4_ENVSTATUS_MALLOC_COUNT 0] 1] allocations"
   783    783   #    incr nErr
   784    784   #    ifcapable memdebug||mem5||(mem3&&debug) {
................................................................................
   792    792   #    }
   793    793   #  }
   794    794     #puts "Maximum memory usage: [sqlite4_memory_highwater 1] bytes"
   795    795     #puts "Current memory usage: [sqlite4_memory_highwater] bytes"
   796    796     #if {[info commands sqlite4_memdebug_malloc_count] ne ""} {
   797    797     #  puts "Number of malloc()  : [sqlite4_memdebug_malloc_count] calls"
   798    798     #}
   799         -  if {$::cmdlinearg(malloctrace)} {
   800         -    puts "Writing malloc() report to malloc.txt..."
   801         -    testmem report malloc.txt
   802         -  }
   803    799     foreach f [glob -nocomplain test.db-*-journal] {
   804    800       forcedelete $f
   805    801     }
   806    802     foreach f [glob -nocomplain test.db-mj*] {
   807    803       forcedelete $f
   808    804     }
   809    805     exit [expr {$nErr>0}]

Changes to test/tkt-9d68c883.test.

    10     10   #***********************************************************************
    11     11   # This file tests that bug  9d68c883132c8e9ffcd5b0c148c990807b5df1b7
    12     12   # is fixed.
    13     13   #
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
           17  +
           18  +ifcapable !memdebug {
           19  +  finish_test
           20  +  return
           21  +}
    17     22   
    18     23   do_test tkt-9d68c88-1.1 {
    19     24     execsql {
    20     25       PRAGMA page_size = 1024;
    21     26       PRAGMA auto_vacuum = 2;
    22     27       CREATE TABLE t3(x);
    23     28       CREATE TABLE t4(x);

Changes to test/where8.test.

   678    678   # At one point the following tests provoked an invalid write error (writing
   679    679   # to memory that had already been freed). It was not possible to demonstrate
   680    680   # that this bug could cause a query to return bad data.
   681    681   # 
   682    682   do_test where8-5.1 {
   683    683     db close
   684    684     sqlite4 db test.db
   685         -  sqlite4_db_config_lookaside db 0 0 0
          685  +  #sqlite4_db_config_lookaside db 0 0 0
   686    686     execsql {
   687    687       CREATE TABLE tA(
   688    688         a, b, c, d, e, f, g, h, 
   689    689         i, j, k, l, m, n, o, p
   690    690       );
   691    691     }
   692    692     execsql {