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 |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7091e990cdf45e0ea8c1dabda4db745b |
User & Date: | dan 2013-05-21 20:08:24.936 |
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
Changes to main.mk.
︙ | ︙ | |||
73 74 75 76 77 78 79 | callback.o complete.o ctime.o date.o delete.o env.o expr.o \ fault.o fkey.o fts5.o fts5func.o \ func.o global.o hash.o \ icu.o insert.o kv.o kvlsm.o kvmem.o legacy.o \ lsm_ckpt.o lsm_file.o lsm_log.o lsm_main.o lsm_mem.o lsm_mutex.o \ lsm_shared.o lsm_str.o lsm_sorted.o lsm_tree.o \ lsm_unix.o lsm_varint.o \ | | | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | callback.o complete.o ctime.o date.o delete.o env.o expr.o \ fault.o fkey.o fts5.o fts5func.o \ func.o global.o hash.o \ icu.o insert.o kv.o kvlsm.o kvmem.o legacy.o \ lsm_ckpt.o lsm_file.o lsm_log.o lsm_main.o lsm_mem.o lsm_mutex.o \ lsm_shared.o lsm_str.o lsm_sorted.o lsm_tree.o \ lsm_unix.o lsm_varint.o \ main.o malloc.o math.o mem.o mem0.o mem2.o mem3.o mem5.o \ mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \ opcodes.o os.o \ pragma.o prepare.o printf.o \ random.o resolve.o rowset.o rtree.o select.o status.o \ tokenize.o trigger.o \ update.o util.o varint.o \ vdbeapi.o vdbeaux.o vdbecodec.o vdbecursor.o \ |
︙ | ︙ | |||
133 134 135 136 137 138 139 | $(TOP)/src/lsm_unix.c \ $(TOP)/src/lsm_varint.c \ $(TOP)/src/main.c \ $(TOP)/src/malloc.c \ $(TOP)/src/math.c \ $(TOP)/src/mem.c \ $(TOP)/src/mem0.c \ | < | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | $(TOP)/src/lsm_unix.c \ $(TOP)/src/lsm_varint.c \ $(TOP)/src/main.c \ $(TOP)/src/malloc.c \ $(TOP)/src/math.c \ $(TOP)/src/mem.c \ $(TOP)/src/mem0.c \ $(TOP)/src/mem2.c \ $(TOP)/src/mem3.c \ $(TOP)/src/mem5.c \ $(TOP)/src/mutex.c \ $(TOP)/src/mutex.h \ $(TOP)/src/mutex_noop.c \ $(TOP)/src/mutex_unix.c \ |
︙ | ︙ |
Changes to src/env.c.
︙ | ︙ | |||
41 42 43 44 45 46 47 | SQLITE4_DEFAULT_MEMSTATUS, /* bMemstat */ 1, /* bCoreMutex */ SQLITE4_THREADSAFE==1, /* bFullMutex */ 0x7ffffffe, /* mxStrlen */ 0, /* szLookaside */ 0, /* nLookaside */ &sqlite4MMSystem, /* pMM */ | < < < | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | SQLITE4_DEFAULT_MEMSTATUS, /* bMemstat */ 1, /* bCoreMutex */ SQLITE4_THREADSAFE==1, /* bFullMutex */ 0x7ffffffe, /* mxStrlen */ 0, /* szLookaside */ 0, /* nLookaside */ &sqlite4MMSystem, /* pMM */ {0,0,0,0,0,0,0,0,0,0}, /* mutex */ (void*)0, /* pHeap */ 0, /* nHeap */ 0, 0, /* mnHeap, mxHeap */ 0, /* mxParserStack */ &sqlite4BuiltinFactory, /* pFactory */ sqlite4OsRandomness, /* xRandomness */ |
︙ | ︙ |
Changes to src/sqlite.h.in.
︙ | ︙ | |||
729 730 731 732 733 734 735 | /* ** CAPIREF: Run-time environment of a database connection ** ** Return the sqlite4_env object to which the database connection ** belongs. */ sqlite4_env *sqlite4_db_env(sqlite4*); | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 729 730 731 732 733 734 735 736 737 738 739 740 741 742 | /* ** CAPIREF: Run-time environment of a database connection ** ** Return the sqlite4_env object to which the database connection ** belongs. */ sqlite4_env *sqlite4_db_env(sqlite4*); /* ** CAPIREF: Database Connection Configuration Options ** ** These constants are the available integer configuration options that ** can be passed as the second argument to the [sqlite4_db_config()] interface. ** |
︙ | ︙ |
Changes to src/sqliteInt.h.
︙ | ︙ | |||
2406 2407 2408 2409 2410 2411 2412 | int bMemstat; /* True to enable memory status */ int bCoreMutex; /* True to enable core mutexing */ int bFullMutex; /* True to enable full mutexing */ int mxStrlen; /* Maximum string length */ int szLookaside; /* Default lookaside buffer size */ int nLookaside; /* Default lookaside buffer count */ sqlite4_mm *pMM; /* Memory allocator for this environment */ | < < < | 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 | int bMemstat; /* True to enable memory status */ int bCoreMutex; /* True to enable core mutexing */ int bFullMutex; /* True to enable full mutexing */ int mxStrlen; /* Maximum string length */ int szLookaside; /* Default lookaside buffer size */ int nLookaside; /* Default lookaside buffer count */ sqlite4_mm *pMM; /* Memory allocator for this environment */ sqlite4_mutex_methods mutex; /* Low-level mutex interface */ void *pHeap; /* Heap storage space */ int nHeap; /* Size of pHeap[] */ int mnReq, mxReq; /* Min and max heap requests sizes */ int mxParserStack; /* maximum depth of the parser stack */ KVFactory *pFactory; /* List of factories */ int (*xRandomness)(sqlite4_env*, int, unsigned char*); |
︙ | ︙ |
Changes to src/update.c.
︙ | ︙ | |||
262 263 264 265 266 267 268 | hasFK = sqlite4FkRequired(pParse, pTab, aXRef); /* Allocate memory for the array aRegIdx[]. There is one entry in the ** array for each index associated with table being updated. Fill in ** the value with a register number for indices that are to be used ** and with zero for unused indices. */ for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){} | > > | | > | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | hasFK = sqlite4FkRequired(pParse, pTab, aXRef); /* Allocate memory for the array aRegIdx[]. There is one entry in the ** array for each index associated with table being updated. Fill in ** the value with a register number for indices that are to be used ** and with zero for unused indices. */ for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){} assert( nIdx>0 || isView ); if( nIdx ){ aRegIdx = sqlite4DbMallocZero(db, sizeof(Index*) * nIdx ); if( aRegIdx==0 ) goto update_cleanup; } /* Allocate registers for and populate the aRegIdx array. */ for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ if( pIdx==pPk || hasFK || bChngPk ){ aRegIdx[j] = ++pParse->nMem; }else{ for(i=0; i<pIdx->nColumn; i++){ |
︙ | ︙ |
Changes to test/auth.test.
︙ | ︙ | |||
2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 | INSERT INTO v1chng VALUES(OLD.x,NEW.x); END; SELECT * FROM v1; } } {115 117} do_test auth-4.3 { set authargs {} execsql { UPDATE v1 SET x=1 WHERE x=117 } set authargs } [list \ SQLITE4_UPDATE v1 x main {} \ SQLITE4_SELECT {} {} {} v1 \ | > | 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 | INSERT INTO v1chng VALUES(OLD.x,NEW.x); END; SELECT * FROM v1; } } {115 117} do_test auth-4.3 { set authargs {} breakpoint execsql { UPDATE v1 SET x=1 WHERE x=117 } set authargs } [list \ SQLITE4_UPDATE v1 x main {} \ SQLITE4_SELECT {} {} {} v1 \ |
︙ | ︙ |
Changes to test/fts5snippet.test.
︙ | ︙ | |||
116 117 118 119 120 121 122 | 1 utf16 } { if {$DO_MALLOC_TEST || $enc=="utf16"} continue db close forcedelete test.db sqlite4 db test.db | < | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | 1 utf16 } { if {$DO_MALLOC_TEST || $enc=="utf16"} continue db close forcedelete test.db sqlite4 db test.db db eval "PRAGMA encoding = \"$enc\"" # Set variable $T to the test name prefix for this iteration of the loop. # set T "fts5snippet-$enc" ########################################################################## |
︙ | ︙ |
Changes to test/malloc_common.tcl.
︙ | ︙ | |||
154 155 156 157 158 159 160 | # faultsim_delete_and_reopen # proc faultsim_save {args} { uplevel db_save $args } proc faultsim_save_and_close {args} { uplevel db_save_and_close $args } proc faultsim_restore {args} { uplevel db_restore $args } proc faultsim_restore_and_reopen {args} { uplevel db_restore_and_reopen $args | | | | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | # faultsim_delete_and_reopen # proc faultsim_save {args} { uplevel db_save $args } proc faultsim_save_and_close {args} { uplevel db_save_and_close $args } proc faultsim_restore {args} { uplevel db_restore $args } proc faultsim_restore_and_reopen {args} { uplevel db_restore_and_reopen $args #sqlite4_db_config_lookaside db 0 0 0 } proc faultsim_delete_and_reopen {args} { uplevel db_delete_and_reopen $args #sqlite4_db_config_lookaside db 0 0 0 } proc faultsim_integrity_check {{db db}} { set ic [$db eval { PRAGMA integrity_check }] if {$ic != "ok"} { error "Integrity check: $ic" } } |
︙ | ︙ | |||
422 423 424 425 426 427 428 | forcedelete test2.db forcedelete test2.db-journal forcedelete test2.db-wal if {[info exists ::mallocopts(-testdb)]} { copy_file $::mallocopts(-testdb) test.db } catch { sqlite4 db test.db } | | | 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | forcedelete test2.db forcedelete test2.db-journal forcedelete test2.db-wal if {[info exists ::mallocopts(-testdb)]} { copy_file $::mallocopts(-testdb) test.db } catch { sqlite4 db test.db } #sqlite4_db_config_lookaside db 0 0 0 # Execute any -tclprep and -sqlprep scripts. # if {[info exists ::mallocopts(-tclprep)]} { eval $::mallocopts(-tclprep) } if {[info exists ::mallocopts(-sqlprep)]} { |
︙ | ︙ |
Changes to test/test_config.c.
︙ | ︙ | |||
77 78 79 80 81 82 83 | #ifdef SQLITE4_DISABLE_LFS Tcl_SetVar2(interp, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY); #endif | | | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | #ifdef SQLITE4_DISABLE_LFS Tcl_SetVar2(interp, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY); #endif #if 0 /* def SQLITE4_MEMDEBUG */ Tcl_SetVar2(interp, "sqlite_options", "memdebug", "1", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "memdebug", "0", TCL_GLOBAL_ONLY); #endif #ifdef SQLITE4_ENABLE_8_3_NAMES Tcl_SetVar2(interp, "sqlite_options", "8_3_names", "1", TCL_GLOBAL_ONLY); |
︙ | ︙ |
Changes to test/test_malloc.c.
︙ | ︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include "tcl.h" #include <stdlib.h> #include <string.h> #include <assert.h> #include "testInt.h" /* ** This structure is used to encapsulate the global state variables used ** by malloc() fault simulation. */ static struct MemFault { int iCountdown; /* Number of pending successes before a failure */ int nRepeat; /* Number of times to repeat the failure */ | > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include "tcl.h" #include <stdlib.h> #include <string.h> #include <assert.h> #include "testInt.h" #if 0 /* ** This structure is used to encapsulate the global state variables used ** by malloc() fault simulation. */ static struct MemFault { int iCountdown; /* Number of pending successes before a failure */ int nRepeat; /* Number of times to repeat the failure */ |
︙ | ︙ | |||
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | if( rc==SQLITE4_OK ){ memfault.isInstalled = 1; } return rc; #endif } #ifdef SQLITE4_TEST /* ** This function is implemented in test1.c. Returns a pointer to a static ** buffer containing the symbolic SQLite error code that corresponds to ** the least-significant 8-bits of the integer passed as an argument. ** For example: ** | > > > | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | if( rc==SQLITE4_OK ){ memfault.isInstalled = 1; } return rc; #endif } #endif #ifdef SQLITE4_TEST #if 0 /* ** This function is implemented in test1.c. Returns a pointer to a static ** buffer containing the symbolic SQLite error code that corresponds to ** the least-significant 8-bits of the integer passed as an argument. ** For example: ** |
︙ | ︙ | |||
1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 | #ifdef SQLITE4_ENABLE_MEMSYS3 const sqlite4_mem_methods *sqlite4MemGetMemsys3(void); rc = sqlite4_env_config(0, SQLITE4_ENVCONFIG_MALLOC, sqlite4MemGetMemsys3()); #endif Tcl_SetResult(interp, (char *)sqlite4TestErrorName(rc), TCL_VOLATILE); return TCL_OK; } static sqlite4_mm *pMMDebug = 0; /* ** tclcmd: test_mm_install ?debug? ?backtrace? ?stats? */ static int test_mm_install( | > > | 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 | #ifdef SQLITE4_ENABLE_MEMSYS3 const sqlite4_mem_methods *sqlite4MemGetMemsys3(void); rc = sqlite4_env_config(0, SQLITE4_ENVCONFIG_MALLOC, sqlite4MemGetMemsys3()); #endif Tcl_SetResult(interp, (char *)sqlite4TestErrorName(rc), TCL_VOLATILE); return TCL_OK; } #endif static sqlite4_mm *pMMDebug = 0; /* ** tclcmd: test_mm_install ?debug? ?backtrace? ?stats? */ static int test_mm_install( |
︙ | ︙ | |||
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 | */ int Sqlitetest_malloc_Init(Tcl_Interp *interp){ static struct { char *zName; Tcl_ObjCmdProc *xProc; int clientData; } aObjCmd[] = { { "sqlite4_malloc", test_malloc ,0 }, { "sqlite4_realloc", test_realloc ,0 }, { "sqlite4_free", test_free ,0 }, { "memset", test_memset ,0 }, { "memget", test_memget ,0 }, { "sqlite4_memdebug_backtrace", test_memdebug_backtrace ,0 }, { "sqlite4_memdebug_dump", test_memdebug_dump ,0 }, { "sqlite4_memdebug_fail", test_memdebug_fail ,0 }, { "sqlite4_memdebug_pending", test_memdebug_pending ,0 }, { "sqlite4_memdebug_settitle", test_memdebug_settitle ,0 }, { "sqlite4_memdebug_malloc_count", test_memdebug_malloc_count ,0 }, { "sqlite4_memdebug_log", test_memdebug_log ,0 }, { "sqlite4_env_status", test_status ,0 }, { "sqlite4_db_status", test_db_status ,0 }, { "install_malloc_faultsim", test_install_malloc_faultsim ,0 }, { "sqlite4_env_config_memstatus", test_config_memstatus ,0 }, { "sqlite4_envconfig_lookaside", test_envconfig_lookaside ,0 }, { "sqlite4_config_error", test_config_error ,0 }, { "sqlite4_db_config_lookaside", test_db_config_lookaside ,0 }, { "sqlite4_install_memsys3", test_install_memsys3 ,0 }, { "test_mm_install", test_mm_install ,0 }, { "test_mm_stat", test_mm_stat ,0 }, { "test_mm_report", test_mm_report ,0 }, }; int i; for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){ ClientData c = (ClientData)SQLITE4_INT_TO_PTR(aObjCmd[i].clientData); Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, c, 0); } return TCL_OK; } #endif | > > | 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 | */ int Sqlitetest_malloc_Init(Tcl_Interp *interp){ static struct { char *zName; Tcl_ObjCmdProc *xProc; int clientData; } aObjCmd[] = { #if 0 { "sqlite4_malloc", test_malloc ,0 }, { "sqlite4_realloc", test_realloc ,0 }, { "sqlite4_free", test_free ,0 }, { "memset", test_memset ,0 }, { "memget", test_memget ,0 }, { "sqlite4_memdebug_backtrace", test_memdebug_backtrace ,0 }, { "sqlite4_memdebug_dump", test_memdebug_dump ,0 }, { "sqlite4_memdebug_fail", test_memdebug_fail ,0 }, { "sqlite4_memdebug_pending", test_memdebug_pending ,0 }, { "sqlite4_memdebug_settitle", test_memdebug_settitle ,0 }, { "sqlite4_memdebug_malloc_count", test_memdebug_malloc_count ,0 }, { "sqlite4_memdebug_log", test_memdebug_log ,0 }, { "sqlite4_env_status", test_status ,0 }, { "sqlite4_db_status", test_db_status ,0 }, { "install_malloc_faultsim", test_install_malloc_faultsim ,0 }, { "sqlite4_env_config_memstatus", test_config_memstatus ,0 }, { "sqlite4_envconfig_lookaside", test_envconfig_lookaside ,0 }, { "sqlite4_config_error", test_config_error ,0 }, { "sqlite4_db_config_lookaside", test_db_config_lookaside ,0 }, { "sqlite4_install_memsys3", test_install_memsys3 ,0 }, #endif { "test_mm_install", test_mm_install ,0 }, { "test_mm_stat", test_mm_stat ,0 }, { "test_mm_report", test_mm_report ,0 }, }; int i; for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){ ClientData c = (ClientData)SQLITE4_INT_TO_PTR(aObjCmd[i].clientData); Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, c, 0); } return TCL_OK; } #endif |
Changes to test/tester.tcl.
︙ | ︙ | |||
81 82 83 84 85 86 87 | # 64KB into the database file instead of the one 1GB in. This means # the code that handles that special case can be tested without creating # very large database files. # set tcl_precision 15 #sqlite4_test_control_pending_byte 0x0010000 | < < | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | # 64KB into the database file instead of the one 1GB in. This means # the code that handles that special case can be tested without creating # very large database files. # set tcl_precision 15 #sqlite4_test_control_pending_byte 0x0010000 # If the pager codec is available, create a wrapper for the [sqlite4] # command that appends "-key {xyzzy}" to the command line. i.e. this: # # sqlite4 db test.db # # becomes |
︙ | ︙ | |||
359 360 361 362 363 364 365 | default { lappend leftover $a } } } set argv $leftover | | | > > > > | | < < > | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | default { lappend leftover $a } } } set argv $leftover # Install the various malloc wrappers. This only needs to be done # once for the process. sqlite4_shutdown set mm stats if {$cmdlinearg(malloctrace)} { lappend mm debug } test_mm_install {*}$mm # install_malloc_faultsim 1 kvwrap install #autoinstall_test_functions sqlite4_initialize # If the --binarylog option was specified, create the logging VFS. This # call installs the new VFS as the default for all SQLite connections. # if {$cmdlinearg(binarylog)} { vfslog new binarylog {} vfslog.bin } |
︙ | ︙ | |||
404 405 406 407 408 409 410 | } reset_db # Abort early if this script has been run before. # if {[info exists TC(count)]} return | < < < < | 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | } reset_db # Abort early if this script has been run before. # if {[info exists TC(count)]} return # Initialize the test counters and set up commands to access them. # Or, if this is a slave interpreter, set up aliases to write the # counters in the parent interpreter. # if {0==[info exists ::SLAVE]} { set TC(errors) 0 set TC(count) 0 |
︙ | ︙ | |||
466 467 468 469 470 471 472 | # proc do_test {name cmd expected} { global argv cmdlinearg fix_testname name | | | 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 | # proc do_test {name cmd expected} { global argv cmdlinearg fix_testname name #sqlite4_memdebug_settitle $name # if {[llength $argv]==0} { # set go 1 # } else { # set go 0 # foreach pattern $argv { # if {[string match $pattern $name]} { |
︙ | ︙ | |||
770 771 772 773 774 775 776 | set nUnit [test_mm_stat units] if {$nOut!=0 || $nUnit!=0} { puts "Unfreed memory: $nOut bytes in $nUnit allocations" } else { puts "All memory allocations freed - no leaks" } show_memstats | > > | > | 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | set nUnit [test_mm_stat units] if {$nOut!=0 || $nUnit!=0} { puts "Unfreed memory: $nOut bytes in $nUnit allocations" } else { puts "All memory allocations freed - no leaks" } show_memstats if {$::cmdlinearg(malloctrace)} { puts "Writing malloc() report to malloc.txt..." test_mm_report malloc.txt } # if {[lindex [sqlite4_env_status SQLITE4_ENVSTATUS_MALLOC_COUNT 0] 1]>0 || # [sqlite4_memory_used]>0} { # puts "Unfreed memory: [sqlite4_memory_used] bytes in\ # [lindex [sqlite4_env_status SQLITE4_ENVSTATUS_MALLOC_COUNT 0] 1] allocations" # incr nErr # ifcapable memdebug||mem5||(mem3&&debug) { |
︙ | ︙ | |||
792 793 794 795 796 797 798 | # } # } #puts "Maximum memory usage: [sqlite4_memory_highwater 1] bytes" #puts "Current memory usage: [sqlite4_memory_highwater] bytes" #if {[info commands sqlite4_memdebug_malloc_count] ne ""} { # puts "Number of malloc() : [sqlite4_memdebug_malloc_count] calls" #} | < < < < | 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | # } # } #puts "Maximum memory usage: [sqlite4_memory_highwater 1] bytes" #puts "Current memory usage: [sqlite4_memory_highwater] bytes" #if {[info commands sqlite4_memdebug_malloc_count] ne ""} { # puts "Number of malloc() : [sqlite4_memdebug_malloc_count] calls" #} foreach f [glob -nocomplain test.db-*-journal] { forcedelete $f } foreach f [glob -nocomplain test.db-mj*] { forcedelete $f } exit [expr {$nErr>0}] |
︙ | ︙ |
Changes to test/tkt-9d68c883.test.
︙ | ︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #*********************************************************************** # This file tests that bug 9d68c883132c8e9ffcd5b0c148c990807b5df1b7 # is fixed. # set testdir [file dirname $argv0] source $testdir/tester.tcl do_test tkt-9d68c88-1.1 { execsql { PRAGMA page_size = 1024; PRAGMA auto_vacuum = 2; CREATE TABLE t3(x); CREATE TABLE t4(x); | > > > > > | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #*********************************************************************** # This file tests that bug 9d68c883132c8e9ffcd5b0c148c990807b5df1b7 # is fixed. # set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable !memdebug { finish_test return } do_test tkt-9d68c88-1.1 { execsql { PRAGMA page_size = 1024; PRAGMA auto_vacuum = 2; CREATE TABLE t3(x); CREATE TABLE t4(x); |
︙ | ︙ |
Changes to test/where8.test.
︙ | ︙ | |||
678 679 680 681 682 683 684 | # At one point the following tests provoked an invalid write error (writing # to memory that had already been freed). It was not possible to demonstrate # that this bug could cause a query to return bad data. # do_test where8-5.1 { db close sqlite4 db test.db | | | 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 | # At one point the following tests provoked an invalid write error (writing # to memory that had already been freed). It was not possible to demonstrate # that this bug could cause a query to return bad data. # do_test where8-5.1 { db close sqlite4 db test.db #sqlite4_db_config_lookaside db 0 0 0 execsql { CREATE TABLE tA( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p ); } execsql { |
︙ | ︙ |