/ Check-in [0a1cce49]
Login

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

Overview
Comment:Disable the undocumented rtreenode() SQL function that is only used for testing, except when doing a build that is specifically intended for testing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.18
Files: files | file ages | folders
SHA3-256: 0a1cce496c515a2ff9c044021ac0e84756830f4ffbb86f5f736bdbb49fb74927
User & Date: drh 2019-09-03 17:46:35
Context
2019-09-03
19:40
Fix a buffer overread that could occur when running fts5 prefix queries inside a transaction. Leaf check-in: b54aa18b user: dan tags: branch-3.18
17:46
Disable the undocumented rtreenode() SQL function that is only used for testing, except when doing a build that is specifically intended for testing. check-in: 0a1cce49 user: drh tags: branch-3.18
17:39
Disable the undocumented rtreenode() SQL function that is only used for testing, except when doing a build that is specifically intended for testing. check-in: 7b4583f9 user: drh tags: branch-3.9
2018-12-19
01:38
Add extra defenses against strategically corrupt databases to fts3/4. check-in: 4bb21d82 user: drh tags: branch-3.18
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rtree/rtree.c.

  3516   3516       assert( pRtree->nBusy==1 );
  3517   3517       rtreeRelease(pRtree);
  3518   3518     }
  3519   3519     return rc;
  3520   3520   }
  3521   3521   
  3522   3522   
         3523  +#if defined(SQLITE_TEST)
  3523   3524   /*
  3524   3525   ** Implementation of a scalar function that decodes r-tree nodes to
  3525   3526   ** human readable strings. This can be used for debugging and analysis.
  3526   3527   **
  3527   3528   ** The scalar function takes two arguments: (1) the number of dimensions
  3528   3529   ** to the rtree (between 1 and 5, inclusive) and (2) a blob of data containing
  3529   3530   ** an r-tree node.  For a two-dimensional r-tree structure called "rt", to
................................................................................
  3577   3578       }else{
  3578   3579         zText = sqlite3_mprintf("{%s}", zCell);
  3579   3580       }
  3580   3581     }
  3581   3582     
  3582   3583     sqlite3_result_text(ctx, zText, -1, sqlite3_free);
  3583   3584   }
         3585  +#endif
  3584   3586   
  3585   3587   /* This routine implements an SQL function that returns the "depth" parameter
  3586   3588   ** from the front of a blob that is an r-tree node.  For example:
  3587   3589   **
  3588   3590   **     SELECT rtreedepth(data) FROM rt_node WHERE nodeno=1;
  3589   3591   **
  3590   3592   ** The depth value is 0 for all nodes other than the root node, and the root
................................................................................
  3606   3608   /*
  3607   3609   ** Register the r-tree module with database handle db. This creates the
  3608   3610   ** virtual table module "rtree" and the debugging/analysis scalar 
  3609   3611   ** function "rtreenode".
  3610   3612   */
  3611   3613   int sqlite3RtreeInit(sqlite3 *db){
  3612   3614     const int utf8 = SQLITE_UTF8;
  3613         -  int rc;
         3615  +  int rc = SQLITE_OK;
  3614   3616   
         3617  +#if defined(SQLITE_TEST)
  3615   3618     rc = sqlite3_create_function(db, "rtreenode", 2, utf8, 0, rtreenode, 0, 0);
         3619  +#endif
  3616   3620     if( rc==SQLITE_OK ){
  3617   3621       rc = sqlite3_create_function(db, "rtreedepth", 1, utf8, 0,rtreedepth, 0, 0);
  3618   3622     }
  3619   3623     if( rc==SQLITE_OK ){
  3620   3624   #ifdef SQLITE_RTREE_INT_ONLY
  3621   3625       void *c = (void *)RTREE_COORD_INT32;
  3622   3626   #else