/ Check-in [95fd296f]
Login

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

Overview
Comment:Fix a prepare-statement leak.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | aux-data-in-rtree
Files: files | file ages | folders
SHA3-256: 95fd296ffc8130526a1453cbdca6ce47f22fc5b5c474aa31d66b627d0c7393a1
User & Date: drh 2018-05-18 16:46:09
Context
2018-05-18
16:53
Avoid unnecessary sqlite3_finalize() operations. check-in: 16f71032 user: drh tags: aux-data-in-rtree
16:46
Fix a prepare-statement leak. check-in: 95fd296f user: drh tags: aux-data-in-rtree
15:21
Improved error messages. Limit the number of auxiliary columns to 100. check-in: 059d20ab user: drh tags: aux-data-in-rtree
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rtree/rtree.c.

  1723   1723     int iCell = 0;
  1724   1724   
  1725   1725     rtreeReference(pRtree);
  1726   1726   
  1727   1727     /* Reset the cursor to the same state as rtreeOpen() leaves it in. */
  1728   1728     freeCursorConstraints(pCsr);
  1729   1729     sqlite3_free(pCsr->aPoint);
         1730  +  sqlite3_finalize(pCsr->pReadAux);
  1730   1731     memset(pCsr, 0, sizeof(RtreeCursor));
  1731   1732     pCsr->base.pVtab = (sqlite3_vtab*)pRtree;
  1732   1733   
  1733   1734     pCsr->iStrategy = idxNum;
  1734   1735     if( idxNum==1 ){
  1735   1736       /* Special case - lookup by rowid. */
  1736   1737       RtreeNode *pLeaf;        /* Leaf on which the required cell resides */

Changes to ext/rtree/rtree1.test.

   633    633     for {set i 12} {$i<=101} {incr i} {
   634    634        append sql ", +a$i"
   635    635     }
   636    636     append sql ");"
   637    637     catchsql $sql
   638    638   } {1 {Too many columns for an rtree table}}
   639    639   
   640         -
   641         -
   642         -
          640  +do_execsql_test 16.130 {
          641  +  DROP TABLE IF EXISTS rt1;
          642  +  CREATE VIRTUAL TABLE rt1 USING rtree(id, x1, x2, +aux);
          643  +  INSERT INTO rt1 VALUES(1, 1, 2, 'aux1');
          644  +  INSERT INTO rt1 VALUES(2, 2, 3, 'aux2');
          645  +  INSERT INTO rt1 VALUES(3, 3, 4, 'aux3');
          646  +  INSERT INTO rt1 VALUES(4, 4, 5, 'aux4');
          647  +  SELECT * FROM rt1 WHERE id IN (1, 2, 3, 4);
          648  +} {1 1.0 2.0 aux1 2 2.0 3.0 aux2 3 3.0 4.0 aux3 4 4.0 5.0 aux4}
   643    649   
   644    650   expand_all_sql db
   645    651   finish_test