/ Check-in [0712f057]
Login

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

Overview
Comment:The RTREE extension should return SQLITE_CORRUPT_VTAB, not just SQLITE_CORRUPT when it encounters incorrectly formatted shadow tables.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0712f057ef3dcd907984dda30f6d961a29b61c1d2b25627028c4e227ec85dbba
User & Date: drh 2017-08-17 18:17:24
Context
2017-08-17
18:23
In sqlite3ViewGetColumnNames(), return the number of errors, not an error code. check-in: f13682ea user: drh tags: trunk
18:17
The RTREE extension should return SQLITE_CORRUPT_VTAB, not just SQLITE_CORRUPT when it encounters incorrectly formatted shadow tables. check-in: 0712f057 user: drh tags: trunk
14:47
Remove an unnecessary branch from the [be436a7f4587ce517ddc] fix. check-in: fb6ca99b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rtree/rtree.c.

  3410   3410           "SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1",
  3411   3411           pRtree->zDb, pRtree->zName
  3412   3412       );
  3413   3413       rc = getIntFromStmt(db, zSql, &pRtree->iNodeSize);
  3414   3414       if( rc!=SQLITE_OK ){
  3415   3415         *pzErr = sqlite3_mprintf("%s", sqlite3_errmsg(db));
  3416   3416       }else if( pRtree->iNodeSize<(512-64) ){
  3417         -      rc = SQLITE_CORRUPT;
         3417  +      rc = SQLITE_CORRUPT_VTAB;
  3418   3418         *pzErr = sqlite3_mprintf("undersize RTree blobs in \"%q_node\"",
  3419   3419                                  pRtree->zName);
  3420   3420       }
  3421   3421     }
  3422   3422   
  3423   3423     sqlite3_free(zSql);
  3424   3424     return rc;

Changes to ext/rtree/rtreeA.test.

   226    226     UPDATE t1_node SET data=x'' WHERE rowid=1;
   227    227   } {}
   228    228   do_catchsql_test rtreeA-7.110 {
   229    229     SELECT * FROM t1 WHERE x1>0 AND x1<100 AND x2>0 AND x2<100;
   230    230   } {1 {undersize RTree blobs in "t1_node"}}
   231    231   do_test rtreeA-7.120 {
   232    232     sqlite3_extended_errcode db
   233         -} {SQLITE_CORRUPT}
          233  +} {SQLITE_CORRUPT_VTAB}
   234    234   
   235    235   
   236    236   
   237    237   finish_test