/ Check-in [81e4d4f8]
Login

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

Overview
Comment:Make sure the sqlite_sequence table is updated when an optional xfer optimization is used. Fix for ticket [7b3328086a5c1].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:81e4d4f897553f6fee540a38c3e83ceac5ba9b78
User & Date: drh 2016-10-03 02:59:33
Context
2016-10-03
12:56
Fix an obsolete comment on a variable definition in expr.c. No code changes. check-in: 012ff6dd user: drh tags: trunk
02:59
Make sure the sqlite_sequence table is updated when an optional xfer optimization is used. Fix for ticket [7b3328086a5c1]. check-in: 81e4d4f8 user: drh tags: trunk
01:21
Allocate Parse objects off of the stack where appropriate for a substantial performance increase and a size reduction. check-in: ea8affa9 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/insert.c.

2173
2174
2175
2176
2177
2178
2179

2180
2181
2182
2183
2184
2185
2186
2187
2188
    sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
    sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
  }
  if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest);
  sqlite3ReleaseTempReg(pParse, regRowid);
  sqlite3ReleaseTempReg(pParse, regData);
  if( emptyDestTest ){

    sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_OK, 0);
    sqlite3VdbeJumpHere(v, emptyDestTest);
    sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
    return 0;
  }else{
    return 1;
  }
}
#endif /* SQLITE_OMIT_XFER_OPT */







>









2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
    sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
    sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
  }
  if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest);
  sqlite3ReleaseTempReg(pParse, regRowid);
  sqlite3ReleaseTempReg(pParse, regData);
  if( emptyDestTest ){
    sqlite3AutoincrementEnd(pParse);
    sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_OK, 0);
    sqlite3VdbeJumpHere(v, emptyDestTest);
    sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
    return 0;
  }else{
    return 1;
  }
}
#endif /* SQLITE_OMIT_XFER_OPT */

Changes to test/autoinc.test.

658
659
660
661
662
663
664












665
666
667
668
        INSERT INTO ta69637_1(y) VALUES(new.z+10000);
      END;
      INSERT INTO va69637_2 VALUES(123);
      SELECT * FROM ta69637_1;
    }
  } {1 124 2 10123}
}















finish_test







>
>
>
>
>
>
>
>
>
>
>
>




658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
        INSERT INTO ta69637_1(y) VALUES(new.z+10000);
      END;
      INSERT INTO va69637_2 VALUES(123);
      SELECT * FROM ta69637_1;
    }
  } {1 124 2 10123}
}

# 2016-10-03 ticket https://www.sqlite.org/src/tktview/7b3328086a5c1
# Make sure autoincrement plays nicely with the xfer optimization
#
do_execsql_test autoinc-10.1 {
  DELETE FROM sqlite_sequence;
  CREATE TABLE t10a(a INTEGER PRIMARY KEY AUTOINCREMENT, b UNIQUE);
  INSERT INTO t10a VALUES(888,9999);
  CREATE TABLE t10b(x INTEGER PRIMARY KEY AUTOINCREMENT, y UNIQUE);
  INSERT INTO t10b SELECT * FROM t10a;
  SELECT * FROM sqlite_sequence;
} {t10a 888 t10b 888}



finish_test