tkt3762.test 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # 2009 March 28
  2. #
  3. # The author disclaims copyright to this source code. In place of
  4. # a legal notice, here is a blessing:
  5. #
  6. # May you do good and not evil.
  7. # May you find forgiveness for yourself and forgive others.
  8. # May you share freely, never taking more than you give.
  9. #
  10. #***********************************************************************
  11. #
  12. # Ticket #3762: Make sure that an incremental vacuum that reduces the
  13. # size of the database file such that if a pointer-map page is eliminated
  14. # it can be correctly rolled back.
  15. #
  16. # That ticket #3762 has been fixed has already been verified by the
  17. # savepoint6.test test script. But this script is simplier and a
  18. # redundant test never hurts.
  19. #
  20. # $Id: tkt3762.test,v 1.1 2009/03/31 00:50:36 drh Exp $
  21. set testdir [file dirname $argv0]
  22. source $testdir/tester.tcl
  23. do_test tkt3762-1.1 {
  24. db eval {
  25. PRAGMA auto_vacuum=INCREMENTAL;
  26. PRAGMA page_size=1024;
  27. PRAGMA cache_size=10;
  28. CREATE TABLE t1(x);
  29. INSERT INTO t1 VALUES(zeroblob(900));
  30. INSERT INTO t1 VALUES(zeroblob(900));
  31. INSERT INTO t1 SELECT x FROM t1;
  32. INSERT INTO t1 SELECT x FROM t1;
  33. INSERT INTO t1 SELECT x FROM t1;
  34. INSERT INTO t1 SELECT x FROM t1;
  35. INSERT INTO t1 SELECT x FROM t1;
  36. INSERT INTO t1 SELECT x FROM t1;
  37. INSERT INTO t1 SELECT x FROM t1;
  38. DELETE FROM t1 WHERE rowid>202;
  39. VACUUM;
  40. BEGIN;
  41. DELETE FROM t1 WHERE rowid IN (10,11,12) ;
  42. PRAGMA incremental_vacuum(10);
  43. UPDATE t1 SET x=zeroblob(900) WHERE rowid BETWEEN 100 AND 110;
  44. INSERT INTO t1 VALUES(zeroblob(39000));
  45. SELECT count(*) FROM t1;
  46. ROLLBACK;
  47. }
  48. db eval {PRAGMA integrity_check}
  49. } {ok}
  50. finish_test