/ Check-in [f483d06a]
Login

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

Overview
Comment:Handle a real OOM condition when incrblob2.test is run on a low-memory machine.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f483d06a9af8d6771090551d911831e1df13bb05a6b7780499594703c28ebbb2
User & Date: drh 2017-07-24 17:37:35
Context
2017-07-24
19:25
Do not attempt to run test file unionvtab.test with SQLITE_OMIT_VIRTUAL_TABLE builds. check-in: 9a5a3d60 user: dan tags: trunk
17:37
Handle a real OOM condition when incrblob2.test is run on a low-memory machine. check-in: f483d06a user: drh tags: trunk
15:29
Additional documentation on sqlite3_bind_pointer() and sqlite3_result_pointer(). No changes to code. check-in: b1572d4e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_blob.c.

   237    237     ){ 
   238    238       return TCL_ERROR;
   239    239     }
   240    240   
   241    241     if( nByte>0 ){
   242    242       zBuf = (unsigned char *)Tcl_AttemptAlloc(nByte);
   243    243       if( zBuf==0 ){
   244         -      Tcl_AppendResult(interp, "out of memory", 0);
          244  +      Tcl_AppendResult(interp, "out of memory in " __FILE__, 0);
   245    245         return TCL_ERROR;
   246    246       }
   247    247     }
   248    248     rc = sqlite3_blob_read(pBlob, zBuf, nByte, iOffset);
   249    249     if( rc==SQLITE_OK ){
   250    250       Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(zBuf, nByte));
   251    251     }else{

Changes to test/incrblob2.test.

   327    327   if {$::tcl_platform(pointerSize)>=8} {
   328    328     do_test incrblob2-6.2b {
   329    329       set rc [catch {
   330    330         # Prior to 2015-02-07, the following caused a segfault due to
   331    331         # integer overflow.
   332    332         sqlite3_blob_read $rdHandle 2147483647 2147483647
   333    333       } errmsg]
          334  +    if {[string match {out of memory in *test_blob.c} $errmsg]} {
          335  +      set errmsg SQLITE_ERROR
          336  +    }
   334    337       lappend rc $errmsg
   335    338     } {1 SQLITE_ERROR}
   336    339   }
   337    340   do_test incrblob2-6.2c {
   338    341     set rc [catch {
   339    342       # Prior to 2015-02-07, the following caused a segfault due to
   340    343       # integer overflow.