recoverclobber.test 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # 2019 April 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. #
  12. # Tests for the SQLITE_RECOVER_ROWIDS option.
  13. #
  14. source [file join [file dirname [info script]] recover_common.tcl]
  15. set testprefix recoverclobber
  16. proc recover {db output} {
  17. set R [sqlite3_recover_init db main test.db2]
  18. $R run
  19. $R finish
  20. }
  21. forcedelete test.db2
  22. do_execsql_test 1.0 {
  23. ATTACH 'test.db2' AS aux;
  24. CREATE TABLE aux.x1(x, one);
  25. INSERT INTO x1 VALUES(1, 'one'), (2, 'two'), (3, 'three');
  26. CREATE TABLE t1(a, b);
  27. INSERT INTO t1 VALUES(1, 1), (2, 2), (3, 3), (4, 4);
  28. DETACH aux;
  29. }
  30. breakpoint
  31. do_test 1.1 {
  32. recover db test.db2
  33. } {}
  34. do_execsql_test 1.2 {
  35. ATTACH 'test.db2' AS aux;
  36. SELECT * FROM aux.t1;
  37. } {1 1 2 2 3 3 4 4}
  38. do_catchsql_test 1.3 {
  39. SELECT * FROM aux.x1;
  40. } {1 {no such table: aux.x1}}
  41. finish_test