/ Check-in [f31d2248]
Login

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

Overview
Comment:Have the xUpdate() method of the rtree module virtual table implementation set the *pRowid output variable when inserting a row. Fix for [dd3ba6063a].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f31d22489d44701c89cb13c663dfa1a6cc04f900
User & Date: dan 2010-03-19 19:02:28
Context
2010-03-19
19:23
Put an ALWAYS() around a condition in pcache.c that must always be true in the current implementation. check-in: 88810cd0 user: drh tags: trunk
19:02
Have the xUpdate() method of the rtree module virtual table implementation set the *pRowid output variable when inserting a row. Fix for [dd3ba6063a]. check-in: f31d2248 user: dan tags: trunk
16:55
Store the SQLite version number of the last writer in bytes 96..99 of the header. check-in: 146d4f5d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rtree/rtree.c.

  2479   2479         if( SQLITE_ROW==sqlite3_step(pRtree->pReadRowid) ){
  2480   2480           sqlite3_reset(pRtree->pReadRowid);
  2481   2481           rc = SQLITE_CONSTRAINT;
  2482   2482           goto constraint;
  2483   2483         }
  2484   2484         rc = sqlite3_reset(pRtree->pReadRowid);
  2485   2485       }
         2486  +    *pRowid = cell.iRowid;
  2486   2487   
  2487   2488       if( rc==SQLITE_OK ){
  2488   2489         rc = ChooseLeaf(pRtree, &cell, 0, &pLeaf);
  2489   2490       }
  2490   2491       if( rc==SQLITE_OK ){
  2491   2492         int rc2;
  2492   2493         pRtree->iReinsertHeight = -1;

Changes to ext/rtree/rtree1.test.

   394    394   #-------------------------------------------------------------------------
   395    395   # Ticket #3970: Check that the error message is meaningful when a 
   396    396   # keyword is used as a column name.
   397    397   #
   398    398   do_test rtree-10.1 {
   399    399     catchsql { CREATE VIRTUAL TABLE t7 USING rtree(index, x1, y1, x2, y2) }
   400    400   } {1 {near "index": syntax error}}
          401  +
          402  +#-------------------------------------------------------------------------
          403  +# Test last_insert_rowid().
          404  +# 
          405  +do_test rtree-11.1 {
          406  +  execsql {
          407  +    CREATE VIRTUAL TABLE t8 USING rtree(idx, x1, x2, y1, y2);
          408  +    INSERT INTO t8 VALUES(1, 1.0, 1.0, 2.0, 2.0);
          409  +    SELECT last_insert_rowid();
          410  +  }
          411  +} {1}
          412  +do_test rtree-11.2 {
          413  +  execsql {
          414  +    INSERT INTO t8 VALUES(NULL, 1.0, 1.0, 2.0, 2.0);
          415  +    SELECT last_insert_rowid();
          416  +  }
          417  +} {2}
   401    418   
   402    419   finish_test