1
0

tkt-5ee23731f.test 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # 2009 October 13
  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 [5ee23731f15] has been
  14. # fixed.
  15. #
  16. set testdir [file dirname $argv0]
  17. source $testdir/tester.tcl
  18. do_test tkt-5ee237-1.1 {
  19. db close
  20. forcedelete test.db
  21. sqlite3 db test.db
  22. db eval {
  23. CREATE TABLE t1(x UNIQUE);
  24. INSERT INTO t1 VALUES(1);
  25. INSERT INTO t1 VALUES(2);
  26. INSERT INTO t1 SELECT x+2 FROM t1;
  27. INSERT INTO t1 SELECT x+4 FROM t1;
  28. INSERT INTO t1 SELECT x+8 FROM t1;
  29. }
  30. db close
  31. sqlite3 db test.db -readonly 1
  32. set rc [catch {
  33. db eval {SELECT rowid, x FROM t1 ORDER BY x} {
  34. db eval {UPDATE t1 SET x=x+1 WHERE rowid=:rowid}
  35. }
  36. } msg]
  37. lappend rc $msg
  38. } {1 {attempt to write a readonly database}}
  39. finish_test