SQLite

Check-in [788f86bebe]
Login

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

Overview
Comment:Fix a case in which the rtree module was ignoring an OOM while generating an error message.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 788f86bebe413b5a0ab41ba3d75ba8728827a964
User & Date: dan 2016-10-10 10:06:59.217
Context
2016-10-10
13:29
Make sure indexes on expressions skip over initial NULL values in the index. Fix for ticket [4baa464912129477f3c9] (check-in: 71797ba431 user: drh tags: trunk)
10:06
Fix a case in which the rtree module was ignoring an OOM while generating an error message. (check-in: 788f86bebe user: dan tags: trunk)
2016-10-08
16:10
Update test/trace3.test to account for the fact that casting a pointer to a 64-bit signed integer might produce a negative value. (check-in: 010ec22541 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/rtree/rtree.c.
3008
3009
3010
3011
3012
3013
3014
3015


3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
static int rtreeQueryStat1(sqlite3 *db, Rtree *pRtree){
  const char *zFmt = "SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'";
  char *zSql;
  sqlite3_stmt *p;
  int rc;
  i64 nRow = 0;

  if( sqlite3_table_column_metadata(db,pRtree->zDb,"sqlite_stat1",


          0,0,0,0,0,0)==SQLITE_ERROR ){
    pRtree->nRowEst = RTREE_DEFAULT_ROWEST;
    return SQLITE_OK;
  }
  zSql = sqlite3_mprintf(zFmt, pRtree->zDb, pRtree->zName);
  if( zSql==0 ){
    rc = SQLITE_NOMEM;
  }else{
    rc = sqlite3_prepare_v2(db, zSql, -1, &p, 0);
    if( rc==SQLITE_OK ){







|
>
>
|

|







3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
static int rtreeQueryStat1(sqlite3 *db, Rtree *pRtree){
  const char *zFmt = "SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'";
  char *zSql;
  sqlite3_stmt *p;
  int rc;
  i64 nRow = 0;

  rc = sqlite3_table_column_metadata(
      db, pRtree->zDb, "sqlite_stat1",0,0,0,0,0,0
  );
  if( rc!=SQLITE_OK ){
    pRtree->nRowEst = RTREE_DEFAULT_ROWEST;
    return rc==SQLITE_ERROR ? SQLITE_OK : rc;
  }
  zSql = sqlite3_mprintf(zFmt, pRtree->zDb, pRtree->zName);
  if( zSql==0 ){
    rc = SQLITE_NOMEM;
  }else{
    rc = sqlite3_prepare_v2(db, zSql, -1, &p, 0);
    if( rc==SQLITE_OK ){