/ Check-in [88333441]
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:The sqlite3_blob_close() interface can cause recursive invocations of nodeBlobReset() in RTREE. Make sure that does not cause problems.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rtree-sqlite3_blob
Files: files | file ages | folders
SHA1: 88333441cbf26bfde2acebf2a3f75b5ebbdfb0ae
User & Date: drh 2017-02-02 15:35:54
Context
2017-02-02
16:08
Fix a potential uninitialized (though harmless) variable in RTREE. check-in: a1c74e09 user: drh tags: rtree-sqlite3_blob
15:35
The sqlite3_blob_close() interface can cause recursive invocations of nodeBlobReset() in RTREE. Make sure that does not cause problems. check-in: 88333441 user: drh tags: rtree-sqlite3_blob
14:40
Change RTREE so that the sqlite3_blob object is closed whenever the cursor count drops to zero and there is not a pending write transaction. check-in: 9bb4eafe user: drh tags: rtree-sqlite3_blob
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rtree/rtree.c.

   621    621   }
   622    622   
   623    623   /*
   624    624   ** Clear the Rtree.pNodeBlob object
   625    625   */
   626    626   static void nodeBlobReset(Rtree *pRtree){
   627    627     if( pRtree->pNodeBlob && pRtree->inWrTrans==0 && pRtree->nCursor==0 ){
   628         -    sqlite3_blob_close(pRtree->pNodeBlob);
          628  +    sqlite3_blob *pBlob = pRtree->pNodeBlob;
   629    629       pRtree->pNodeBlob = 0;
          630  +    sqlite3_blob_close(pBlob);
   630    631     }
   631    632   }
   632    633   
   633    634   /*
   634    635   ** Obtain a reference to an r-tree node.
   635    636   */
   636    637   static int nodeAcquire(