fts3drop.test 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # 2011 October 29
  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. The
  12. # focus of this script is testing the FTS3 module. More specifically,
  13. # that DROP TABLE commands can co-exist with savepoints inside transactions.
  14. # See ticket [48f299634a] for details.
  15. #
  16. set testdir [file dirname $argv0]
  17. source $testdir/tester.tcl
  18. set testprefix fts3drop
  19. # If SQLITE_ENABLE_FTS3 is defined, omit this file.
  20. ifcapable !fts3 {
  21. finish_test
  22. return
  23. }
  24. do_execsql_test 1.1 {
  25. CREATE VIRTUAL TABLE f1 USING fts3;
  26. INSERT INTO f1 VALUES('a b c');
  27. }
  28. do_execsql_test 1.2 {
  29. BEGIN;
  30. INSERT INTO f1 VALUES('d e f');
  31. SAVEPOINT one;
  32. INSERT INTO f1 VALUES('g h i');
  33. DROP TABLE f1;
  34. ROLLBACK TO one;
  35. COMMIT;
  36. }
  37. do_execsql_test 1.3 {
  38. SELECT * FROM f1;
  39. } {{a b c} {d e f}}
  40. do_execsql_test 1.4 {
  41. BEGIN;
  42. INSERT INTO f1 VALUES('g h i');
  43. SAVEPOINT one;
  44. INSERT INTO f1 VALUES('j k l');
  45. DROP TABLE f1;
  46. RELEASE one;
  47. ROLLBACK;
  48. }
  49. do_execsql_test 1.5 {
  50. SELECT * FROM f1;
  51. } {{a b c} {d e f}}
  52. finish_test