/ Check-in [a1132dd9]
Login

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

Overview
Comment:Fix a problem detecting invalid values in the rbu_control column of an rbu database table.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rbu-percent-progress
Files: files | file ages | folders
SHA1: a1132dd9027d1c6dd845be307eeb38e535393f2c
User & Date: dan 2016-03-19 17:09:30
Context
2016-03-19
17:48
Add the sqlite3rbu_bp_progress() API to the RBU extension. Used to obtain the percentage progress of an RBU update. (check-in: 209e31c7 user: dan tags: trunk)
17:09
Fix a problem detecting invalid values in the rbu_control column of an rbu database table. (Closed-Leaf check-in: a1132dd9 user: dan tags: rbu-percent-progress)
16:21
Update the sqldiff tool so that it generates an rbu_count table. (check-in: 1f7afb6e user: dan tags: rbu-percent-progress)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rbu/rbu1.test.

   607    607            CREATE TABLE rbu.data_t1(a, b, rbu_control);
   608    608            INSERT INTO rbu.data_t1 VALUES(1, 2, 4);
   609    609          } {SQLITE_ERROR - invalid rbu_control value}
   610    610   
   611    611          9 {
   612    612            CREATE TABLE t1(a, b PRIMARY KEY) WITHOUT ROWID;
   613    613            CREATE TABLE rbu.data_t1(a, b, rbu_control);
   614         -         INSERT INTO rbu.data_t1 VALUES(1, 2, 2);
          614  +         INSERT INTO rbu.data_t1 VALUES(1, 2, 3);
   615    615          } {SQLITE_ERROR - invalid rbu_control value}
   616    616   
   617    617          10 {
   618    618            CREATE TABLE t2(a, b);
   619    619            CREATE TABLE rbu.data_t1(a, b, rbu_control);
   620    620            INSERT INTO rbu.data_t1 VALUES(1, 2, 2);
   621    621          } {SQLITE_ERROR - no such table: t1}

Changes to ext/rbu/sqlite3rbu.c.

  2702   2702     if( eType ){
  2703   2703       assert( eType==RBU_INSERT     || eType==RBU_DELETE
  2704   2704            || eType==RBU_REPLACE    || eType==RBU_IDX_DELETE
  2705   2705            || eType==RBU_IDX_INSERT || eType==RBU_UPDATE
  2706   2706       );
  2707   2707       assert( eType!=RBU_UPDATE || pIter->zIdx==0 );
  2708   2708   
  2709         -    if( pIter->zIdx==0 && eType==RBU_IDX_DELETE ){
         2709  +    if( pIter->zIdx==0 && (eType==RBU_IDX_DELETE || eType==RBU_IDX_INSERT) ){
  2710   2710         rbuBadControlError(p);
  2711   2711       }
  2712   2712       else if( eType==RBU_REPLACE ){
  2713   2713         if( pIter->zIdx==0 ){
  2714   2714           p->nPhaseOneStep += p->objiter.nIndex;
  2715   2715           rbuStepOneOp(p, RBU_DELETE);
  2716   2716         }