SQLite

Check-in [88333441cb]
Login

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
Timelines: family | ancestors | descendants | both | rtree-sqlite3_blob
Files: files | file ages | folders
SHA1: 88333441cbf26bfde2acebf2a3f75b5ebbdfb0ae
User & Date: drh 2017-02-02 15:35:54.700
Context
2017-02-02
16:08
Fix a potential uninitialized (though harmless) variable in RTREE. (check-in: a1c74e09d6 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: 88333441cb 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: 9bb4eafe1a user: drh tags: rtree-sqlite3_blob)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/rtree/rtree.c.
621
622
623
624
625
626
627
628
629

630
631
632
633
634
635
636
}

/*
** Clear the Rtree.pNodeBlob object
*/
static void nodeBlobReset(Rtree *pRtree){
  if( pRtree->pNodeBlob && pRtree->inWrTrans==0 && pRtree->nCursor==0 ){
    sqlite3_blob_close(pRtree->pNodeBlob);
    pRtree->pNodeBlob = 0;

  }
}

/*
** Obtain a reference to an r-tree node.
*/
static int nodeAcquire(







|

>







621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
}

/*
** Clear the Rtree.pNodeBlob object
*/
static void nodeBlobReset(Rtree *pRtree){
  if( pRtree->pNodeBlob && pRtree->inWrTrans==0 && pRtree->nCursor==0 ){
    sqlite3_blob *pBlob = pRtree->pNodeBlob;
    pRtree->pNodeBlob = 0;
    sqlite3_blob_close(pBlob);
  }
}

/*
** Obtain a reference to an r-tree node.
*/
static int nodeAcquire(