tkt-d11f09d36e.test 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # 2010 June 26
  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. # Test that the bug reported by ticket d11f09d36e7cb0821e01f4 has
  13. # been fixed.
  14. #
  15. set testdir [file dirname $argv0]
  16. source $testdir/tester.tcl
  17. set a_string_counter 1
  18. proc a_string {n} {
  19. global a_string_counter
  20. incr a_string_counter
  21. string range [string repeat "${a_string_counter}." $n] 1 $n
  22. }
  23. db func a_string a_string
  24. do_test tkt-d11f09d36e.1 {
  25. execsql {
  26. PRAGMA synchronous = NORMAL;
  27. PRAGMA cache_size = 10;
  28. CREATE TABLE t1(x, y, UNIQUE(x, y));
  29. BEGIN;
  30. }
  31. for {set i 0} {$i < 10000} {incr i} {
  32. execsql { INSERT INTO t1 VALUES($i, $i) }
  33. }
  34. execsql COMMIT
  35. } {}
  36. do_test tkt-d11f09d36e.2 {
  37. execsql {
  38. BEGIN;
  39. UPDATE t1 set x = x+10000;
  40. ROLLBACK;
  41. }
  42. } {}
  43. do_test tkt-d11f09d36e.3 {
  44. execsql { PRAGMA integrity_check }
  45. } {ok}
  46. do_test tkt-d11f09d36e.4 {
  47. execsql {
  48. SAVEPOINT tr;
  49. UPDATE t1 set x = x+10000;
  50. ROLLBACK TO tr;
  51. RELEASE tr;
  52. }
  53. } {}
  54. do_test tkt-d11f09d36e.5 {
  55. execsql { PRAGMA integrity_check }
  56. } {ok}
  57. finish_test