tkt-94c04eaadb.test 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # 2009 October 19
  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. set testdir [file dirname $argv0]
  14. source $testdir/tester.tcl
  15. if {[info commands sqlite3async_initialize] eq ""} {
  16. # The async logic is not built into this system
  17. finish_test
  18. return
  19. }
  20. # Create a database.
  21. do_test tkt-94c94-1.1 {
  22. execsql { CREATE TABLE t1(a, b) }
  23. } {}
  24. # Grow the file to larger than 4096MB (2^32 bytes)
  25. db close
  26. if {[catch {fake_big_file 4096 [get_pwd]/test.db} msg]} {
  27. puts "**** Unable to create a file larger than 4096 MB. *****"
  28. finish_test
  29. return
  30. }
  31. # Switch to async mode.
  32. sqlite3async_initialize "" 1
  33. sqlite3 db test.db
  34. sqlite3 db2 test.db
  35. # Read from and write to the db just past the 4096MB mark.
  36. #
  37. do_test tkt-94c94-2.1 {
  38. execsql { CREATE TABLE t2(x, y) } db
  39. } {}
  40. do_test tkt-94c94-2.2 {
  41. breakpoint
  42. execsql { INSERT INTO t2 VALUES(1, 2) } db2
  43. } {}
  44. do_test tkt-94c94-2.3 {
  45. execsql { SELECT * FROM t2 } db
  46. } {1 2}
  47. do_test tkt-94c94-2.4 {
  48. sqlite3async_control halt idle
  49. sqlite3async_start
  50. sqlite3async_wait
  51. } {}
  52. do_test tkt-94c94-2.5 {
  53. execsql { SELECT * FROM t2 } db
  54. } {1 2}
  55. do_test tkt-94c94-2.6 {
  56. sqlite3async_start
  57. sqlite3async_wait
  58. } {}
  59. db close
  60. db2 close
  61. sqlite3async_start
  62. sqlite3async_wait
  63. sqlite3async_control halt never
  64. sqlite3async_shutdown
  65. finish_test