tkt1567.test 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # 2005 December 19 2005
  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. # This file implements regression tests for SQLite library.
  12. #
  13. # This file implements tests to verify that ticket #1567 is
  14. # fixed.
  15. #
  16. set testdir [file dirname $argv0]
  17. source $testdir/tester.tcl
  18. do_test tkt1567-1.1 {
  19. execsql {
  20. CREATE TABLE t1(a TEXT PRIMARY KEY);
  21. }
  22. set bigstr abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  23. for {set i 0} {$i<100} {incr i} {
  24. set x [format %5d [expr $i*2]]
  25. set sql "INSERT INTO t1 VALUES('$x-$bigstr')"
  26. execsql $sql
  27. }
  28. } {}
  29. integrity_check tkt1567-1.2
  30. do_test tkt1567-1.3 {
  31. execsql {
  32. BEGIN;
  33. UPDATE t1 SET a = a||'x' WHERE rowid%2==0;
  34. }
  35. } {}
  36. do_test tkt1567-1.4 {
  37. catchsql {
  38. UPDATE t1 SET a = CASE WHEN rowid<90 THEN substr(a,1,10) ELSE '9999' END;
  39. }
  40. } {1 {column a is not unique}}
  41. do_test tkt1567-1.5 {
  42. execsql {
  43. COMMIT;
  44. }
  45. } {}
  46. integrity_check tkt1567-1.6
  47. finish_test