recovercorrupt2.test 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. # 2022 August 28
  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. source [file join [file dirname [info script]] recover_common.tcl]
  13. set testprefix recovercorrupt2
  14. do_execsql_test 1.0 {
  15. PRAGMA page_size = 512;
  16. CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
  17. INSERT INTO t1 VALUES(1, 2, 3);
  18. INSERT INTO t1 VALUES(2, hex(randomblob(100)), randomblob(200));
  19. CREATE INDEX i1 ON t1(b, c);
  20. CREATE TABLE t2(a PRIMARY KEY, b, c) WITHOUT ROWID;
  21. INSERT INTO t2 VALUES(1, 2, 3);
  22. INSERT INTO t2 VALUES(2, hex(randomblob(100)), randomblob(200));
  23. ANALYZE;
  24. PRAGMA writable_schema = 1;
  25. UPDATE sqlite_schema SET sql = 'CREATE INDEX i1 ON o(world)' WHERE name='i1';
  26. DELETE FROM sqlite_schema WHERE name='sqlite_stat4';
  27. }
  28. do_test 1.1 {
  29. set R [sqlite3_recover_init db main test.db2]
  30. $R run
  31. $R finish
  32. } {}
  33. sqlite3 db2 test.db2
  34. do_execsql_test -db db2 1.2 {
  35. SELECT sql FROM sqlite_schema
  36. } {
  37. {CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c)}
  38. {CREATE TABLE t2(a PRIMARY KEY, b, c) WITHOUT ROWID}
  39. {CREATE TABLE sqlite_stat1(tbl,idx,stat)}
  40. }
  41. db2 close
  42. do_execsql_test 1.3 {
  43. PRAGMA writable_schema = 1;
  44. UPDATE sqlite_schema SET sql = 'CREATE TABLE t2 syntax error!' WHERE name='t2';
  45. }
  46. do_test 1.4 {
  47. set R [sqlite3_recover_init db main test.db2]
  48. $R run
  49. $R finish
  50. } {}
  51. sqlite3 db2 test.db2
  52. do_execsql_test -db db2 1.5 {
  53. SELECT sql FROM sqlite_schema
  54. } {
  55. {CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c)}
  56. {CREATE TABLE sqlite_stat1(tbl,idx,stat)}
  57. }
  58. db2 close
  59. #-------------------------------------------------------------------------
  60. #
  61. reset_db
  62. do_test 2.0 {
  63. sqlite3 db {}
  64. db deserialize [decode_hexdb {
  65. | size 8192 pagesize 4096 filename x3.db
  66. | page 1 offset 0
  67. | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
  68. | 16: 10 00 01 01 00 40 20 20 00 00 00 02 00 00 00 02 .....@ ........
  69. | 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................
  70. | 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
  71. | 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................
  72. | 96: 00 2e 63 00 0d 00 00 00 01 0f d8 00 0f d8 00 00 ..c.............
  73. | 4048: 00 00 00 00 00 00 00 00 26 01 06 17 11 11 01 39 ........&......9
  74. | 4064: 74 61 62 6c 65 74 31 74 31 02 43 52 45 41 54 45 tablet1t1.CREATE
  75. | 4080: 20 54 41 42 4c 45 20 74 31 28 61 2c 62 2c 63 29 TABLE t1(a,b,c)
  76. | page 2 offset 4096
  77. | 0: 0d 00 00 00 01 0f ce 00 0f ce 00 00 00 00 00 00 ................
  78. | 4032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ..............(.
  79. | 4048: ff ff ff ff ff ff ff 28 04 27 25 23 61 61 61 61 .........'%#aaaa
  80. | 4064: 61 61 61 61 61 61 61 61 61 62 62 62 62 62 62 62 aaaaaaaaabbbbbbb
  81. | 4080: 62 62 62 62 62 63 63 63 63 63 63 63 63 63 63 63 bbbbbccccccccccc
  82. | end x3.db
  83. }]} {}
  84. do_test 2.1 {
  85. set R [sqlite3_recover_init db main test.db2]
  86. $R run
  87. $R finish
  88. } {}
  89. sqlite3 db2 test.db2
  90. do_execsql_test -db db2 2.2 {
  91. SELECT sql FROM sqlite_schema
  92. } {
  93. {CREATE TABLE t1(a,b,c)}
  94. }
  95. do_execsql_test -db db2 2.3 {
  96. SELECT * FROM t1
  97. } {}
  98. db2 close
  99. #-------------------------------------------------------------------------
  100. #
  101. reset_db
  102. do_test 3.0 {
  103. sqlite3 db {}
  104. db deserialize [decode_hexdb {
  105. .open --hexdb
  106. | size 4096 pagesize 1024 filename corrupt032.txt.db
  107. | page 1 offset 0
  108. | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
  109. | 16: 04 00 01 01 08 40 20 20 00 00 00 02 00 00 00 03 .....@ ........
  110. | 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................
  111. | 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
  112. | 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................
  113. | 96: 00 2e 24 80 0d 00 00 00 01 03 d4 00 03 d4 00 00 ..$.............
  114. | 976: 00 00 00 00 22 01 06 17 11 11 01 31 74 61 62 6c ...........1tabl
  115. | 992: 65 74 31 74 31 02 43 52 45 41 54 45 20 54 41 42 et1t1.CREATE TAB
  116. | 1008: 4c 45 20 74 31 28 78 29 00 00 00 00 00 00 00 00 LE t1(x)........
  117. | page 2 offset 1024
  118. | 0: 0d 00 00 00 01 02 06 00 02 06 00 00 00 00 00 00 ................
  119. | 512: 00 00 00 00 00 00 8b 60 01 03 97 46 00 00 00 00 .......`...F....
  120. | 1008: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 ................
  121. | end corrupt032.txt.db
  122. }]} {}
  123. do_test 3.1 {
  124. set R [sqlite3_recover_init db main test.db2]
  125. $R run
  126. $R finish
  127. } {}
  128. #-------------------------------------------------------------------------
  129. #
  130. reset_db
  131. do_test 4.0 {
  132. sqlite3 db {}
  133. db deserialize [decode_hexdb {
  134. .open --hexdb
  135. | size 4096 pagesize 4096 filename crash-00f2d3627f1b43.db
  136. | page 1 offset 0
  137. | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
  138. | 16: 00 01 01 02 00 40 20 20 01 00 ff 00 42 01 10 01 .....@ ....B...
  139. | 32: ef 00 00 87 00 ff ff ff f0 01 01 10 ff ff 00 00 ................
  140. | end crash-00f2d3627f1b43.db
  141. }]} {}
  142. do_test 4.1 {
  143. set R [sqlite3_recover_init db main test.db2]
  144. catch { $R run }
  145. list [catch { $R finish } msg] $msg
  146. } {1 {unable to open database file}}
  147. #-------------------------------------------------------------------------
  148. #
  149. reset_db
  150. do_test 5.0 {
  151. sqlite3 db {}
  152. db deserialize [decode_hexdb {
  153. .open --hexdb
  154. | size 16384 pagesize 4096 filename crash-7b75760a4c5f15.db
  155. | page 1 offset 0
  156. | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
  157. | 16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 04 .....@ ........
  158. | 32: 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 00 ................
  159. | 96: 00 00 00 00 0d 00 00 00 03 0f 4e 00 0f bc 0f 90 ..........N.....
  160. | 112: 0f 4e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .N..............
  161. | 3904: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 03 ..............@.
  162. | 3920: 06 17 11 11 01 6d 74 61 62 6c 65 74 32 74 32 04 .....mtablet2t2.
  163. | 3936: 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 32 28 CREATE TABLE t2(
  164. | 3952: 78 2c 79 2c 7a 20 50 52 49 4d 41 52 59 20 4b 45 x,y,z PRIMARY KE
  165. | 3968: 59 29 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44 Y) WITHOUT ROWID
  166. | 3984: 2a 02 06 17 13 11 01 3f 69 6e 64 65 78 74 31 61 *......?indext1a
  167. | 4000: 74 31 03 43 52 45 41 54 45 20 49 4e 44 45 58 20 t1.CREATE INDEX
  168. | 4016: 74 31 61 20 4f 4e 20 74 31 28 61 29 42 01 06 17 t1a ON t1(a)B...
  169. | 4032: 11 11 01 71 74 61 62 6c 65 74 31 74 31 02 43 52 ...qtablet1t1.CR
  170. | 4048: 45 41 54 45 20 54 41 42 4c 45 20 74 31 28 61 20 EATE TABLE t1(a
  171. | 4064: 49 4e 54 2c 62 20 54 45 58 54 2c 63 20 42 4c 4f INT,b TEXT,c BLO
  172. | 4080: 42 2c 64 20 52 45 41 4c 29 20 53 54 52 49 43 54 B,d REAL) STRICT
  173. | page 2 offset 4096
  174. | 0: 0d 00 00 00 14 0c ae 00 0f df 0f bd 0f 9a 0f 76 ...............v
  175. | 16: 0f 51 0f 2b 0f 04 0e dc 0e b3 0e 89 0e 5e 0e 32 .Q.+.........^.2
  176. | 32: 0e 05 0d 1a 0d a8 0d 78 0d 47 0d 15 0c e2 00 00 .......x.G......
  177. | 3232: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 14 ..............2.
  178. | 3248: 05 06 3f 34 07 15 f4 c9 23 af e2 b3 b6 61 62 63 ..?4....#....abc
  179. | 3264: 30 32 30 78 79 7a 01 00 00 00 00 00 00 00 00 00 020xyz..........
  180. | 3280: 00 00 00 00 00 00 00 00 00 00 c3 b0 96 7e fb 4e .............~.N
  181. | 3296: c5 4c 31 13 05 06 1f 32 07 dd f2 2a a5 7e b2 4d .L1....2...*.~.M
  182. | 3312: 82 61 62 63 30 31 39 78 79 7a 01 00 00 00 00 00 .abc019xyz......
  183. | 3328: 00 00 00 00 00 00 00 00 00 00 00 00 00 c3 a3 d6 ................
  184. | 3344: e9 f1 c2 fd f3 30 12 05 06 1f 30 07 8f 8f f5 c4 .....0....0.....
  185. | 3360: 35 b6 7f 8d 61 62 63 30 31 38 00 00 00 00 00 00 5...abc018......
  186. | 3376: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 ...............C
  187. | 3392: b2 13 1f 9d 56 8a 47 21 b1 05 06 1f 2e 07 7f 46 ....V.G!.......F
  188. | 3408: 91 03 3f 97 fb f7 61 62 63 30 00 00 00 00 00 00 ..?...abc0......
  189. | 3440: c3 bb d8 96 86 c2 e8 2b 2e 10 05 06 1f 2c 07 6d .......+.....,.m
  190. | 3456: 85 7b ce d0 32 d2 54 61 62 63 30 00 00 00 00 00 ....2.Tabc0.....
  191. | 3488: 43 a1 eb 44 14 dc 03 7b 2d 0f 05 06 1f 2a 07 d9 C..D....-....*..
  192. | 3504: ab ec bf 34 51 70 f3 61 62 63 30 31 35 78 79 7a ...4Qp.abc015xyz
  193. | 3520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c3 ................
  194. | 3536: b6 3d f4 46 b1 6a af 2c 0e 05 06 1f 28 07 36 75 .=.F.j.,....(.6u
  195. | 3552: e9 a2 bd 05 04 ea 61 62 63 30 31 34 78 79 7a 00 ......abc014xyz.
  196. | 3568: 00 00 00 00 00 00 00 00 00 00 00 00 00 c3 ab 23 ...............#
  197. | 3584: a7 6a 34 ca f8 2b 0d 05 06 1f 26 07 48 45 ab e0 .j4..+....&.HE..
  198. | 3600: 8c 7c ff 0c 61 62 63 30 31 33 78 79 7a 00 00 00 .|..abc013xyz...
  199. | 3616: 00 00 00 00 0d d0 00 00 00 00 43 b8 d3 93 f4 92 ..........C.....
  200. | 3632: 5b 7a 2a 0c 05 06 1f 24 07 be 6d 1e db 61 5d 80 [z*....$..m..a].
  201. | 3648: 9f 61 62 63 30 31 32 78 79 7a 00 00 00 00 00 00 .abc012xyz......
  202. | 3664: 00 00 00 00 00 00 43 b5 a1 a4 af 7b c6 60 29 0b ......C......`).
  203. | 3680: 05 06 1f 22 07 6e a2 a3 64 68 d4 a6 bd 61 62 63 .....n..dh...abc
  204. | 3696: 30 31 31 78 79 7a 00 00 00 00 00 00 00 00 00 00 011xyz..........
  205. | 3712: 00 c3 c4 1e ff 0f fc e6 ff 28 0a 05 06 1f 20 07 .........(.... .
  206. | 3728: 50 f9 4a bb a5 7a 1e ca 61 62 63 30 31 30 78 79 P.J..z..abc010xy
  207. | 3744: 7a 00 00 00 00 00 00 00 00 00 00 c3 a7 90 ed d9 z...............
  208. | 3760: 5c 2c d5 27 09 05 06 1f 1e 07 90 8e 1d d9 1c 3a .,.'...........:
  209. | 3776: e8 c1 61 62 63 30 30 39 78 79 7a 00 00 00 00 00 ..abc009xyz.....
  210. | 3792: 00 00 00 00 43 a7 97 87 cf b0 ff 79 26 08 05 06 ....C......y&...
  211. | 3808: 1f 1c 07 86 65 f6 7c 50 7a 2c 76 61 62 63 30 30 ....e.|Pz,vabc00
  212. | 3824: 38 78 79 7a 00 00 00 00 00 00 00 00 c3 b0 e3 4c 8xyz...........L
  213. | 3840: 4f d3 41 b5 25 07 05 06 1f 1a 07 8b 20 e5 68 11 O.A.%....... .h.
  214. | 3856: 13 55 87 61 62 63 30 30 37 78 79 7a 00 00 00 00 .U.abc007xyz....
  215. | 3872: 00 00 00 c3 b6 a3 74 f1 9c 33 f8 24 06 05 06 1f ......t..3.$....
  216. | 3888: 18 07 97 3c bc 34 49 94 54 ab 61 62 63 30 30 36 ...<.4I.T.abc006
  217. | 3904: 78 79 7a 00 00 00 00 00 00 c3 88 00 c2 ca 4c 4d xyz...........LM
  218. | 3920: d3 23 05 05 06 1f 16 07 59 37 11 10 e9 e5 3d d5 .#......Y7....=.
  219. | 3936: 61 62 63 30 30 35 78 79 7a 00 00 00 00 00 c3 c0 abc005xyz.......
  220. | 3952: 15 12 67 ed 4b 79 22 04 05 06 1f 14 07 93 39 01 ..g.Ky........9.
  221. | 3968: 7f b8 c7 99 58 61 62 63 30 30 34 78 79 7a 00 00 ....Xabc004xyz..
  222. | 3984: 09 c0 43 bf e0 e7 6d 70 fd 61 21 03 05 06 1f 12 ..C...mp.a!.....
  223. | 4000: 07 b6 df 8d 8b 27 08 22 5a 61 62 63 30 30 33 78 .....'..Zabc003x
  224. | 4016: 79 7a 00 00 00 c3 c7 ea 0f dc dd 32 22 20 02 05 yz.........2. ..
  225. | 4032: 06 1f 10 07 2f a6 da 71 df 66 b3 b5 61 62 63 30 ..../..q.f..abc0
  226. | 4048: 30 32 78 79 7a 00 00 c3 ce d9 8d e9 ec 20 45 1f 02xyz........ E.
  227. | 4064: 01 05 06 1f 0e 07 5a 47 53 20 3b 48 8f c0 61 62 ......ZGS ;H..ab
  228. | 4080: 63 30 30 31 78 79 7a 00 c3 c9 e6 81 f8 d9 24 04 c001xyz.......$.
  229. | page 3 offset 8192
  230. | 0: 0a 00 00 00 14 0e fd 00 0f f3 0f e6 0f d9 0f cc ................
  231. | 16: 0f bf 0f b2 0f a5 0f 98 0f 8b 0f 7e 0f 71 0f 64 ...........~.q.d
  232. | 32: 0f 57 0f 4a 0f 3d 0f 30 0f 24 00 00 00 00 00 00 .W.J.=.0.$......
  233. | 3824: 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 03 06 ................
  234. | 3840: 01 7f 46 91 03 3f 97 fb f7 11 0c 03 06 01 6e a2 ..F..?........n.
  235. | 3856: a3 64 68 d4 a6 bd 0b 0c 03 06 01 6d 85 7b ce d0 .dh........m....
  236. | 3872: 32 d2 54 10 0b 03 06 09 5a 47 53 20 3b 48 8f c0 2.T.....ZGS ;H..
  237. | 3888: 0c 03 06 01 59 37 11 10 e9 e5 3d d5 05 0c 03 06 ....Y7....=.....
  238. | 3904: 01 50 f9 4a bb a5 7a 1e ca 0a 0c 03 06 01 48 45 .P.J..z.......HE
  239. | 3920: ab e0 8c 7c ff 0c 0d 0c 03 06 01 36 75 e9 a2 bd ...|.......6u...
  240. | 3936: 05 04 ea 0e 0c 03 06 01 2f a6 da 71 df 66 b3 b5 ......../..q.f..
  241. | 3952: 02 0c 03 06 01 15 f4 c9 23 af e2 b3 b6 14 0c 03 ........#.......
  242. | 3968: 06 01 dd f2 2a a5 7e b2 4d 82 13 0c 03 06 01 d9 ....*.~.M.......
  243. | 3984: ab ec bf 34 51 70 f3 0f 0c 03 06 01 be 6d 1e db ...4Qp.......m..
  244. | 4000: 61 5d 80 9f 0c 0c 03 06 01 b6 df 8d 8b 27 08 22 a]...........'..
  245. | 4016: 5a 03 0c 03 06 01 97 3c bc 34 49 94 54 ab 06 0c Z......<.4I.T...
  246. | 4032: 03 06 01 93 39 01 7f b8 c7 99 58 04 0c 03 06 01 ....9.....X.....
  247. | 4048: 90 8e 1d d9 1c 3a e8 c1 09 0c 03 06 01 8f 8f f5 .....:..........
  248. | 4064: c4 35 b6 7f 8d 12 0c 03 06 01 8b 20 e5 68 11 13 .5......... .h..
  249. | 4080: 55 87 07 0c 03 06 01 86 65 f6 7c 50 7a 2b 06 08 U.......e.|Pz+..
  250. | page 4 offset 12288
  251. | 0: 0a 00 00 00 14 0f 62 00 0f 7a 0f a1 0f c9 0f d9 ......b..z......
  252. | 16: 0f 81 0f d1 0f f1 0f f9 0f e1 0f 89 0e 6a 0f c1 .............j..
  253. | 32: 0f 91 0f 99 0f b9 0f 72 0f 62 0f e9 0f b1 0f a9 .......r.b......
  254. | 3936: 00 00 07 04 01 01 01 11 0e 9e 07 04 01 01 01 0b ................
  255. | 3952: 31 16 07 04 01 01 01 10 37 36 06 04 09 01 01 ab 1.......76......
  256. | 3968: 58 07 04 01 01 01 05 1c 28 07 04 01 01 01 0a 10 X.......(.......
  257. | 3984: cf 07 04 01 01 01 0d b2 e3 07 04 01 01 01 0e d3 ................
  258. | 4000: f2 07 04 01 01 01 02 41 ad 07 04 01 01 01 14 3e .......A.......>
  259. | 4016: 22 07 04 01 01 01 13 27 45 07 04 01 01 01 0f ad .......'E.......
  260. | 4032: dd 07 04 01 01 01 0c 2e a1 07 04 01 01 01 03 df ................
  261. | 4048: e1 07 04 01 01 01 06 59 a7 07 04 01 01 01 04 27 .......Y.......'
  262. | 4064: bd 07 04 01 01 01 09 d0 e0 07 04 01 01 01 12 39 ...............9
  263. | 4080: 4f 07 04 01 01 01 07 c4 11 06 04 00 00 00 00 00 O...............
  264. | end crash-7b75760a4c5f15.db
  265. }]} {}
  266. do_test 5.1 {
  267. set R [sqlite3_recover_init db main test.db2]
  268. catch { $R run }
  269. list [catch { $R finish } msg] $msg
  270. } {0 {}}
  271. #-------------------------------------------------------------------------
  272. #
  273. reset_db
  274. do_test 6.0 {
  275. sqlite3 db {}
  276. db deserialize [decode_hexdb {
  277. | size 8192 pagesize 4096 filename abc.db
  278. | page 1 offset 0
  279. | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
  280. | 16: 10 00 01 01 00 40 20 20 00 00 00 02 00 00 00 02 .....@ ........
  281. | 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................
  282. | 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
  283. | 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................
  284. | 96: 00 2e 6e b8 0d 00 00 00 01 0f dc 00 0f dc 00 00 ..n.............
  285. | 4048: 00 00 00 00 00 00 00 00 00 00 00 00 22 01 06 17 ................
  286. | 4064: 11 11 01 31 74 61 62 6c 65 74 31 74 31 02 43 52 ...1tablet1t1.CR
  287. | 4080: 45 41 54 45 20 54 41 42 4c 45 20 74 31 28 78 29 EATE TABLE t1(x)
  288. | page 2 offset 4096
  289. | 0: 0d 00 00 00 01 0f e2 00 0f e2 00 00 00 00 00 00 ................
  290. | 4064: 00 00 1c 01 02 41 61 62 63 64 65 66 67 68 69 6a .....Aabcdefghij
  291. | 4080: 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a klmnopqrstuvwxyz
  292. | end abc.db
  293. }]} {}
  294. do_test 6.1 {
  295. set R [sqlite3_recover_init db main test.db2]
  296. catch { $R run }
  297. list [catch { $R finish } msg] $msg
  298. } {0 {}}
  299. reset_db
  300. breakpoint
  301. do_test 6.2 {
  302. sqlite3 db {}
  303. db deserialize [decode_hexdb {
  304. | size 8192 pagesize 4096 filename abc.db
  305. | page 1 offset 0
  306. | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
  307. | 16: 10 00 01 01 00 40 20 20 00 00 00 02 00 00 00 02 .....@ ........
  308. | 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................
  309. | 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
  310. | 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................
  311. | 96: 00 2e 6e b8 0d 00 00 00 01 0f dc 00 0f dc 00 00 ..n.............
  312. | 4048: 00 00 00 00 00 00 00 00 00 00 00 00 22 01 06 17 ................
  313. | 4064: 11 11 01 31 74 61 62 6c 65 74 31 74 31 02 43 52 ...1tablet1t1.CR
  314. | 4080: 45 41 54 45 20 54 41 42 4c 45 20 74 31 28 78 29 EATE TABLE t1(x)
  315. | page 2 offset 4096
  316. | 0: 0d 00 00 00 01 0f e2 00 0f e2 00 00 00 00 00 00 ................
  317. | 4064: 00 00 1c 01 02 8F FF FF FF 7E 65 66 67 68 69 6a .....Aabcdefghij
  318. | 4080: 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a klmnopqrstuvwxyz
  319. | end abc.db
  320. }]} {}
  321. do_test 6.3 {
  322. set R [sqlite3_recover_init db main test.db2]
  323. catch { $R run }
  324. list [catch { $R finish } msg] $msg
  325. } {0 {}}
  326. reset_db
  327. breakpoint
  328. do_test 7.0 {
  329. sqlite3 db {}
  330. db deserialize [decode_hexdb {
  331. | size 4108 pagesize 4096 filename x1.db
  332. | page 1 offset 0
  333. | 0: 02 01 00 00 00 00 14 15 40 00 00 00 00 00 00 00 ........@.......
  334. | 16: 33 3a 6d 65 6d 6f 72 79 3a 02 02 02 02 02 02 02 3:memory:.......
  335. | 32: 02 02 02 02 02 02 12 02 02 02 63 6f 6c 6f 72 20 ..........color
  336. | 48: 73 70 61 63 00 f3 a0 81 a1 00 00 a0 02 02 02 02 spac............
  337. | 64: 69 95 73 6f 36 00 ff 0d 00 97 8c 90 3f 0a 70 02 i.so6.......?.p.
  338. | 80: 02 02 02 02 02 02 02 02 02 02 02 02 02 01 00 00 ................
  339. | 96: 06 02 02 02 02 5f 02 02 02 2c 02 02 02 02 02 02 ....._...,......
  340. | 112: 02 02 02 02 02 02 02 02 02 12 02 02 02 63 6f 6c .............col
  341. | 128: 6f 72 20 73 70 61 63 00 f3 a0 81 a1 00 00 a0 02 or spac.........
  342. | 144: 02 02 02 69 95 73 6f 36 00 ff 0d 00 97 8c 90 3f ...i.so6.......?
  343. | 160: 0a 70 02 02 02 02 02 02 02 02 02 02 02 02 02 02 .p..............
  344. | 176: 01 00 00 06 02 02 02 02 5f 02 02 02 2c 02 02 00 ........_...,...
  345. | 192: 00 01 00 01 00 00 00 01 00 02 fe 00 00 03 00 01 ................
  346. | 208: 00 00 00 01 c5 04 00 00 00 01 00 01 00 00 00 01 ................
  347. | 224: 00 fa 02 00 00 00 03 00 01 00 00 00 81 00 04 00 ................
  348. | 240: 00 00 01 00 01 00 00 00 01 00 02 00 fe 00 03 00 ................
  349. | 256: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................
  350. | 272: 01 00 02 00 00 00 03 00 01 00 00 00 01 00 04 00 ................
  351. | 288: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................
  352. | 304: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................
  353. | 320: 01 00 02 00 00 00 03 00 01 00 00 00 40 00 84 00 ............@...
  354. | 336: 84 00 84 00 01 00 00 00 09 00 06 00 f5 00 01 00 ................
  355. | 352: 08 01 03 00 03 00 62 00 62 00 23 00 01 00 62 00 ......b.b.#...b.
  356. | 368: 04 00 1e 00 62 00 62 00 62 00 01 00 00 00 0a 00 ....b.b.b.......
  357. | 384: 01 00 03 00 01 00 03 00 04 00 02 00 01 00 01 00 ................
  358. | 400: 08 00 01 00 31 c6 00 03 00 0c 00 12 00 18 00 02 ....1...........
  359. | 416: 00 05 00 08 00 02 00 06 00 08 00 02 00 07 00 08 ................
  360. | 432: 00 02 00 01 00 01 00 08 00 01 00 0c 00 03 00 16 ................
  361. | 448: 00 1c 00 22 00 01 00 03 00 05 00 06 00 07 00 02 ................
  362. | 464: 00 05 00 09 00 02 00 06 00 09 00 02 00 07 00 09 ................
  363. | 480: 00 00 00 00 01 00 05 00 00 00 01 00 01 00 00 00 ................
  364. | 496: 01 00 02 00 00 00 03 00 01 00 00 00 01 00 04 00 ................
  365. | 512: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................
  366. | 528: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................
  367. | 544: 01 00 02 00 00 f6 03 00 00 02 00 00 01 00 04 00 ................
  368. | 560: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................
  369. | 576: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................
  370. | 592: 01 00 02 00 00 00 03 00 01 00 00 00 01 00 04 00 ................
  371. | 608: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................
  372. | 624: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................
  373. | 640: 01 3d 02 00 00 00 03 00 06 00 00 00 01 00 01 00 .=..............
  374. | 656: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................
  375. | 672: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................
  376. | 688: 01 00 02 00 00 00 55 52 4c 52 65 71 75 65 73 74 ......URLRequest
  377. | 704: 43 6f 6e 00 00 00 01 01 0e d4 00 04 00 00 00 01 Con.............
  378. | 720: 0e f8 00 04 00 00 00 01 0f 1c 00 04 00 00 00 01 ................
  379. | 736: 0f 00 00 01 00 00 00 01 0f 86 00 01 00 00 00 01 ................
  380. | 752: 0f 84 00 01 00 00 00 01 00 00 01 0f c0 00 01 00 ................
  381. | 768: 00 00 01 0f e8 00 d6 0f 00 01 6f 00 02 0f d6 00 ..........o.....
  382. | 784: 02 34 03 03 03 00 01 00 00 00 01 00 05 00 00 00 .4..............
  383. | 800: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 01 00 ................
  384. | 816: 00 00 01 00 04 00 00 00 01 00 01 00 00 00 01 00 ................
  385. | 832: 02 00 00 00 03 00 01 00 10 00 01 00 04 00 00 00 ................
  386. | 848: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 00 02 ................
  387. | 864: 00 00 01 40 04 00 00 03 01 00 01 00 00 00 01 00 ...@............
  388. | 880: 02 00 00 00 03 00 01 00 00 00 00 00 01 0e f8 00 ................
  389. | 896: 04 77 4f 46 32 73 40 23 70 00 00 00 70 00 1f 00 .wOF2s@#p...p...
  390. | 912: 00 00 d8 00 00 00 ff ff 00 00 00 00 43 00 00 00 ............C...
  391. | 928: 00 00 ff ff ff ff ff 00 00 a8 00 00 0c 00 00 00 ................
  392. | 1024: 00 00 00 00 00 00 00 00 00 00 10 22 00 22 0f 00 ................
  393. | 1040: 00 00 00 00 00 00 10 22 00 00 70 00 1f 00 00 0f ..........p.....
  394. | 1056: d8 00 00 00 00 00 00 00 00 00 03 00 00 00 00 00 ................
  395. | 1072: 00 01 00 00 00 3f 23 70 00 00 00 01 0f 1c 00 04 .....?#p........
  396. | 1088: 00 00 00 01 0f 40 00 01 00 00 00 01 0f 86 00 01 .....@..........
  397. | 1104: 00 00 00 01 0f 84 00 01 00 00 00 01 00 00 01 0f ................
  398. | 1120: c0 00 01 00 00 00 01 0f e8 00 01 0f d6 00 6f 00 ..............o.
  399. | 1136: 02 0f d6 00 03 02 31 03 2b 03 2a f2 00 0f d4 00 ......1.+.*.....
  400. | 1152: 01 00 08 00 01 00 04 03 2b 00 02 02 32 00 01 0f ........+...2...
  401. | 1168: c8 01 15 00 02 20 c8 00 02 12 ad 02 00 24 06 c0 ..... .......$..
  402. | 1184: 00 00 00 03 00 00 01 24 00 2a 06 e4 00 00 00 03 .......$.*......
  403. | 1200: 00 00 01 25 00 38 07 0e 00 00 00 03 00 00 01 26 ...%.8.........&
  404. | 1216: 00 34 07 46 00 00 00 03 00 00 01 27 00 1c 07 7a .4.F.......'...z
  405. | 1232: 00 00 00 03 00 00 01 28 00 2a 07 96 00 00 00 03 .......(.*......
  406. | 1248: 00 e5 01 29 00 34 07 c0 00 00 00 03 00 00 01 2a ...).4.........*
  407. | 1264: 67 34 07 f4 00 00 00 03 00 00 01 2b 00 22 08 28 g4.........+...(
  408. | 1280: 00 00 00 00 01 00 01 00 00 00 01 00 02 00 00 00 ................
  409. | 1296: 03 00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 ................
  410. | 1312: 01 00 00 00 01 00 02 00 00 00 03 00 00 02 00 00 ................
  411. | 1328: 01 00 04 00 00 00 01 00 01 00 00 00 01 00 02 00 ................
  412. | 1344: 00 00 03 00 01 00 00 00 01 00 04 00 00 00 01 00 ................
  413. | 1360: 01 00 00 00 01 00 02 00 00 00 03 00 01 00 00 21 ...............!
  414. | 1376: 04 00 01 00 00 00 00 00 01 00 00 00 01 00 02 00 ................
  415. | 1392: 00 00 03 00 01 00 00 00 01 00 04 00 00 00 01 00 ................
  416. | 1408: 01 00 00 00 01 00 02 00 00 00 03 00 01 00 00 00 ................
  417. | 1424: 01 00 05 00 00 00 01 00 01 00 00 01 00 02 02 02 ................
  418. | 1440: 12 02 02 02 63 6f 6c 6f 72 20 73 70 61 63 00 f3 ....color spac..
  419. | 1456: a0 81 a1 00 00 a0 02 02 02 02 69 95 73 6f 36 00 ..........i.so6.
  420. | 1472: ff 0d 00 97 8c 90 3f 0a 70 02 02 02 02 02 02 02 ......?.p.......
  421. | 1488: 02 02 02 02 02 02 02 01 00 00 06 02 02 02 02 5f ..............._
  422. | 1504: 02 02 02 2c 02 02 00 00 01 00 01 00 00 00 01 00 ...,............
  423. | 1520: 02 fe 00 00 03 00 01 00 00 00 01 c5 04 00 00 00 ................
  424. | 1536: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 01 00 ................
  425. | 1552: 00 00 81 00 04 00 00 00 01 00 01 00 00 00 01 00 ................
  426. | 1568: 02 00 fe 00 03 00 01 00 00 00 01 00 04 00 00 00 ................
  427. | 1584: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 01 00 ................
  428. | 1600: 00 00 01 00 04 00 00 00 01 00 01 00 00 00 01 00 ................
  429. | 1616: 02 00 00 00 03 00 01 00 00 00 01 00 04 00 00 00 ................
  430. | 1632: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 01 00 ................
  431. | 1648: 00 00 40 00 84 00 84 00 84 00 01 00 00 00 09 00 ..@.............
  432. | 1664: 06 00 f5 00 01 00 08 01 03 15 15 15 15 15 15 15 ................
  433. | 1680: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................
  434. | 1696: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................
  435. | 1712: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................
  436. | 1728: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................
  437. | 1744: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................
  438. | 1760: 15 15 15 15 15 15 15 15 15 15 15 00 03 00 62 00 ..............b.
  439. | 1776: 62 00 23 00 01 00 62 00 04 00 1e 00 62 00 62 00 b.#...b.....b.b.
  440. | 1792: 62 00 01 00 00 00 0a 00 01 00 03 00 01 00 03 00 b...............
  441. | 1808: 04 00 02 00 01 00 01 00 08 00 01 00 31 c6 00 03 ............1...
  442. | 1824: 00 0c 00 12 00 18 00 02 00 05 00 08 00 02 00 06 ................
  443. | 1840: 00 08 00 02 00 07 00 08 00 02 00 01 00 01 00 08 ................
  444. | 1856: 00 01 00 0c 00 03 00 16 00 1c 00 22 00 01 00 03 ................
  445. | 1872: 00 05 00 06 00 07 00 02 00 05 00 09 00 02 00 06 ................
  446. | 1888: 00 09 00 02 00 07 00 09 00 00 00 00 01 00 05 00 ................
  447. | 1904: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................
  448. | 1920: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................
  449. | 1936: 01 00 02 00 00 00 03 00 01 00 00 00 01 00 04 00 ................
  450. | 1952: 00 00 01 0f d6 00 02 34 03 03 03 00 01 00 00 00 .......4........
  451. | 1968: 01 00 05 00 00 00 01 00 01 00 00 00 01 00 02 00 ................
  452. | 1984: 00 00 03 00 01 00 00 00 01 00 04 00 00 00 01 00 ................
  453. | 2000: 01 00 00 00 01 00 02 fc 42 dc 19 5c 74 23 18 cd ........B...t#..
  454. | 2016: b3 a5 a8 7a 90 40 1d 66 12 5d e5 4f 85 00 68 f4 ...z.@.f.].O..h.
  455. | 2032: 05 98 86 25 24 dd bc c2 f6 f6 4e a3 e2 61 d2 c6 ...%$.....N..a..
  456. | 2048: aa c1 56 50 d4 80 82 35 f1 e2 59 41 50 a6 da 51 ..VP...5..YAP..Q
  457. | 2064: d4 62 9c 19 94 58 aa 31 30 8a 22 c2 5f 33 2b c9 .b...X.10..._3+.
  458. | 2080: b6 e6 b4 11 4e 51 82 c4 d8 b6 d8 b4 06 04 fb 68 ....NQ.........h
  459. | 2096: f4 d2 6f e7 cb 8a a8 82 d5 74 00 00 00 00 00 00 ..o......t......
  460. | 2368: 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 ................
  461. | 2432: 00 00 00 00 00 03 00 01 00 10 00 01 00 04 00 00 ................
  462. | 2448: 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 00 ................
  463. | 2464: 02 00 00 01 40 04 00 00 03 01 00 01 00 00 00 01 ....@...........
  464. | 2480: 00 02 00 00 00 03 00 01 00 00 00 00 00 01 0e f8 ................
  465. | 2496: 00 04 77 4f 46 32 73 40 23 70 00 00 00 70 00 1f ..wOF2s@#p...p..
  466. | 2512: 00 00 00 d8 00 00 00 ff ff 00 00 00 00 43 00 00 .............C..
  467. | 2528: 00 00 00 ff ff ff ff ff 00 00 a8 00 00 0c 00 00 ................
  468. | 2624: 00 00 00 00 00 00 00 00 00 00 00 10 22 00 22 0f ................
  469. | 2640: 00 00 00 00 00 00 00 10 22 00 00 70 00 1f 00 00 ...........p....
  470. | 2656: 0f d8 00 00 00 00 00 00 00 00 00 03 00 00 00 00 ................
  471. | 2672: 00 00 01 00 00 00 3f 23 70 00 00 00 01 0f 1c 00 ......?#p.......
  472. | 2688: 04 00 00 00 01 0f 40 00 01 00 00 00 01 0f 86 00 ......@.........
  473. | 2704: 01 00 00 00 01 0f 84 00 01 00 00 00 01 00 00 01 ................
  474. | 2720: 0f c0 00 01 00 00 00 01 0f e8 00 01 0f d6 00 6f ...............o
  475. | 2736: 00 02 0f d6 00 03 02 31 03 2b 03 2a f2 00 0f d4 .......1.+.*....
  476. | 2752: 00 01 00 08 00 01 00 04 03 2b 00 02 02 32 00 01 .........+...2..
  477. | 2768: 0f c8 01 15 00 02 20 c8 00 02 12 ad 02 00 24 06 ...... .......$.
  478. | 2784: c0 00 00 5a 03 00 00 01 24 00 2a 06 e4 00 00 00 ...Z....$.*.....
  479. | 2800: 03 00 00 01 25 00 38 07 0e 00 00 00 03 00 00 01 ....%.8.........
  480. | 2816: 26 00 34 07 46 00 00 00 03 00 00 01 27 00 1c 07 &.4.F.......'...
  481. | 2832: 7a 00 00 00 03 00 00 01 28 00 2a 07 96 00 00 00 z.......(.*.....
  482. | 2848: 03 00 e5 01 29 00 34 07 c0 00 00 00 03 00 00 01 ....).4.........
  483. | 2864: 2a 67 34 07 f4 00 00 00 03 00 00 01 2b 00 22 08 *g4.........+...
  484. | 2880: 28 00 00 00 00 01 00 01 00 00 00 01 00 02 00 00 (...............
  485. | 2896: 00 03 00 01 00 00 00 01 00 00 00 01 00 00 00 01 ................
  486. | 2912: 00 01 00 00 00 01 00 02 00 00 00 03 00 00 02 00 ................
  487. | 2928: 00 01 00 04 00 00 00 01 00 01 00 00 00 00 00 00 ................
  488. | 2992: 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .H..............
  489. | 3504: 00 00 00 00 00 00 00 00 00 00 00 97 00 00 00 00 ................
  490. | 3904: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 ................
  491. | 3920: 03 fe 00 00 01 36 00 3c 0a 38 00 00 00 03 00 00 .....6.<.8......
  492. | 3936: 01 37 00 20 0a 74 00 00 00 fb ff ff 00 38 00 2a .7. .t.......8.*
  493. | 3952: 0a 94 00 00 00 03 00 00 01 39 4f 54 54 4f 00 0e .........9OTTO..
  494. | 3968: 00 80 00 03 00 60 43 46 46 20 e3 ae 89 2a 00 00 .....`CFF ...*..
  495. | 3984: 02 b0 00 00 02 76 42 50 4f 53 00 15 00 0a 00 00 .....vBPOS......
  496. | 4000: 05 28 00 00 00 0c 54 53 55 42 c9 70 c3 06 00 00 .(....TSUB.p....
  497. | 4016: 05 34 1f 00 40 00 48 00 00 00 00 00 00 00 00 00 .4..@.H.........
  498. | 4064: 00 00 00 00 00 08 00 01 00 01 00 01 00 01 00 06 ................
  499. | 4080: 00 02 00 08 00 01 00 01 00 01 00 01 00 00 00 00 ................
  500. | end x1.db
  501. }]} {}
  502. do_test 7.1 {
  503. set R [sqlite3_recover_init db main test.db2]
  504. catch { $R run }
  505. list [catch { $R finish } msg] $msg
  506. } {1 {file is not a database}}
  507. reset_db
  508. do_test 8.0 {
  509. sqlite3 db {}
  510. db deserialize [decode_hexdb {
  511. | size 8192 pagesize 4096 filename db.sqlite
  512. | page 1 offset 0
  513. | 0: ac ae b3 76 74 65 20 66 6f 72 6d 61 74 20 33 00 ...vte format 3.
  514. | 16: 10 00 01 01 00 40 20 20 00 00 00 01 00 00 00 02 .....@ ........
  515. | 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................
  516. | 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
  517. | 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................
  518. | 96: 00 2e 76 8a 0d ff ff ff 1e 0f cb 00 0f cb 00 00 ..v.............
  519. | 4032: 00 00 00 00 00 00 00 00 00 00 00 33 01 06 17 19 ...........3....
  520. | 4048: 19 01 43 74 61 62 6c 65 54 61 62 6c 65 30 54 61 ..CtableTable0Ta
  521. | 4064: 62 6c 65 30 02 43 52 45 41 54 45 20 54 41 42 4c ble0.CREATE TABL
  522. | 4080: 45 20 54 61 62 6c 65 30 20 28 43 6f 6c 30 20 29 E Table0 (Col0 )
  523. | page 2 offset 4096
  524. | 0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 ................
  525. | end db.sqlite
  526. }]} {}
  527. do_test 8.1 {
  528. set R [sqlite3_recover_init db main test.db2]
  529. catch { $R run }
  530. list [catch { $R finish } msg] $msg
  531. } {0 {}}
  532. reset_db
  533. do_test 9.0 {
  534. sqlite3 db {}
  535. db deserialize [decode_hexdb {
  536. | size 16384 pagesize 4096t 0
  537. | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00
  538. | 16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 06 ........
  539. | 32: 00 00 00 0r 00 00 00 00 00 00 00 06 00 00 00 04 ..
  540. | 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ........
  541. | 96: 00 00 00 00 0d 00 00 00 06 0d e2 00 0f c4 0f 6a .......j
  542. | 112: 0e fc 0e 9d 0e 3d 0d e2 00 00 00 00 00 00 00 00 .
  543. | 3552: 00 00 59 06 06 17 21 21 01 7f 74 61 62 6c 65 74 ..tablet
  544. | 3568: 74 74 5f 63 6f 6e 66 69 67 74 74 74 5f 63 6f 6econ
  545. | 3584: 66 69 67 06 43 52 45 41 54 45 20 54 41 42 4c 45
  546. | 3616: 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 76 29 20 )
  547. | 3632: 57 49 54 48 4f 55 54 20 52 4f 57 49 44 5e 05 07 WOWID^..
  548. | 3648: 17 23 23 01 81 03 74 61 62 6c 65 74 74 74 5f 6tt_d
  549. | 3664: 6f 63 73 69 7a 65 74 74 74 5f 64 6f 63 73 69 7a z
  550. | 3680: 65 05 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 e.ABLE '
  551. | 3696: 74 74 74 5f 64 6f 63 73 69 7a 65 27 28 69 64 20id
  552. | 3712: 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20
  553. | 3728: 4b 45 59 2c 20 73 7a 20 42 4c 4f 42 29 5d 04 07 KEYB)]..
  554. | 3744: 17 23 23 01 81 B1 74 61 62 6c 65 74 74 74 5f 63 _c
  555. | 3760: 6f 6e 74 65 6e 74 74 74 74 5f 63 6f 6e 74 65 6e o_conten
  556. | 3776: 7 04 01 03 00 011 54 45 20 54 41 42 4c 45 20 27 t.CRLE '
  557. | 3792: 74 74 74 5f 63 6f 6e 74 65 6e 74 27 28 69 64 20
  558. | 3808: 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 INIMARY
  559. | 3904: 6f 2c 20 50 52 49 4d 41 52 59 20 4b 45 59 28 7EY(s
  560. | 3920: 65 67 69 64 2c 20 74 65 72 6d 29 29 20 57 49 54 T
  561. | 3936: 48 4f 55 54 20 52 4f 57 49 4 58 58 02 07 17 1d 1d ..
  562. | 3952: 01 81 03 74 61 62 6c 65 74 74 74 5f 64 61 74 61 .tt_data
  563. | 3968: 74 74 74 5f 64 61 74 61 02 43 52 45 41 54 45 2ATE
  564. | 3984: 54 41 42 4c 45 20 27 74 74 74 5f 64 61 74 61 27 '
  565. | 4000: 28 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d (iR PRIM
  566. | 4016: 41 52 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42k B
  567. | 4032: 4c 4f 42 29 3a 01 06 17 13 13 08 5f 74 61 62 6c
  568. | 4048: 65 74 74 74 74 74 74 43 52 45 41 54 45 20 56 49 ettTE VI
  569. | 4064: 52 54 55 41 4c 20 54 41 42 4c 45 20 74 74 74 20 t
  570. | 4080: 55 53 49 4e 47 20 66 74 73 35 28 61 2c 20 62 29 U5(a, b)
  571. | page 4 offset 12288
  572. | 0: 0a 00 00 00 03 0f ea 00 0f fa 0f f2 0f ea 00 00 ........
  573. | 4064: 00 00 00 00 00 00 00 00 00 00 07 04 01 01 01 05 ..
  574. | 4080: 06 03 07 04 01 01 01 03 04 02 05 04 09 01 09 02 ........
  575. | end ro2.t
  576. }]} {}
  577. do_test 9.1 {
  578. set R [sqlite3_recover_init db main test.db2]
  579. catch { $R run }
  580. list [catch { $R finish } msg] $msg
  581. } {0 {}}
  582. finish_test