tkt-4a03edc4c8.test 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # 2009 September 23
  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
  14. # ticket [4a03edc4c8c028c93e9269f64fc5e97f632c1166] has been fixed.
  15. #
  16. set testdir [file dirname $argv0]
  17. source $testdir/tester.tcl
  18. do_test tkt-4a03ed-1.1 {
  19. db eval {
  20. CREATE TABLE t1(
  21. a INTEGER PRIMARY KEY ON CONFLICT REPLACE,
  22. b UNIQUE ON CONFLICT FAIL
  23. );
  24. INSERT INTO t1 VALUES(1, 1);
  25. INSERT INTO t1 VALUES(2, 2);
  26. }
  27. catchsql {
  28. BEGIN;
  29. INSERT INTO t1 VALUES(1, 2);
  30. COMMIT;
  31. }
  32. } {1 {column b is not unique}}
  33. do_test tkt-4a03ed-1.2 {
  34. db eval {
  35. PRAGMA integrity_check;
  36. }
  37. } {ok}
  38. do_test tkt-4a03ed-1.3 {
  39. db eval {
  40. SELECT * FROM t1 ORDER BY a;
  41. }
  42. } {1 1 2 2}
  43. finish_test