From 3accc7e1af59b89cc54df381ddf67dc96487103f Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 2 Feb 2017 16:30:25 +0000 Subject: [PATCH] Remove the unused pReadNode prepared statement from each RTREE object. FossilOrigin-Name: e51dc0ec60d45cd57564735b6b2bb254a588533e --- ext/rtree/rtree.c | 24 ++++++++++-------------- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/ext/rtree/rtree.c b/ext/rtree/rtree.c index 432c72781e..9e6f0e082a 100644 --- a/ext/rtree/rtree.c +++ b/ext/rtree/rtree.c @@ -139,7 +139,6 @@ struct Rtree { sqlite3_blob *pNodeBlob; /* Statements to read/write/delete a record from xxx_node */ - sqlite3_stmt *pReadNode; sqlite3_stmt *pWriteNode; sqlite3_stmt *pDeleteNode; @@ -944,7 +943,6 @@ static void rtreeRelease(Rtree *pRtree){ pRtree->inWrTrans = 0; pRtree->nCursor = 0; nodeBlobReset(pRtree); - sqlite3_finalize(pRtree->pReadNode); sqlite3_finalize(pRtree->pWriteNode); sqlite3_finalize(pRtree->pDeleteNode); sqlite3_finalize(pRtree->pReadRowid); @@ -3315,10 +3313,9 @@ static int rtreeSqlInit( ){ int rc = SQLITE_OK; - #define N_STATEMENT 9 + #define N_STATEMENT 8 static const char *azSql[N_STATEMENT] = { - /* Read and write the xxx_node table */ - "SELECT data FROM '%q'.'%q_node' WHERE nodeno = :1", + /* Write the xxx_node table */ "INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(:1, :2)", "DELETE FROM '%q'.'%q_node' WHERE nodeno = :1", @@ -3356,15 +3353,14 @@ static int rtreeSqlInit( } } - appStmt[0] = &pRtree->pReadNode; - appStmt[1] = &pRtree->pWriteNode; - appStmt[2] = &pRtree->pDeleteNode; - appStmt[3] = &pRtree->pReadRowid; - appStmt[4] = &pRtree->pWriteRowid; - appStmt[5] = &pRtree->pDeleteRowid; - appStmt[6] = &pRtree->pReadParent; - appStmt[7] = &pRtree->pWriteParent; - appStmt[8] = &pRtree->pDeleteParent; + appStmt[0] = &pRtree->pWriteNode; + appStmt[1] = &pRtree->pDeleteNode; + appStmt[2] = &pRtree->pReadRowid; + appStmt[3] = &pRtree->pWriteRowid; + appStmt[4] = &pRtree->pDeleteRowid; + appStmt[5] = &pRtree->pReadParent; + appStmt[6] = &pRtree->pWriteParent; + appStmt[7] = &pRtree->pDeleteParent; rc = rtreeQueryStat1(db, pRtree); for(i=0; i