Get rid of "-encoding binary" across all test cases, as that is no longer
[sqlite.git] / ext / recover / recoverrowid.test
blob5855e84fa65055bd4988bf55a607acdd994582f1
1 # 2022 September 07
3 # The author disclaims copyright to this source code.  In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
11
12 # Tests for the SQLITE_RECOVER_ROWIDS option.
15 source [file join [file dirname [info script]] recover_common.tcl]
16 set testprefix recoverrowid
18 proc recover {db bRowids output} {
19   forcedelete $output
21   set R [sqlite3_recover_init db main test.db2]
22   $R config rowids $bRowids
23   $R run
24   $R finish
27 do_execsql_test 1.0 {
28   CREATE TABLE t1(a, b);
29   INSERT INTO t1 VALUES(1, 1), (2, 2), (3, 3), (4, 4);
30   DELETE FROM t1 WHERE a IN (1, 3);
33 do_test 1.1 {
34   recover db 0 test.db2
35   sqlite3 db2 test.db2
36   execsql { SELECT rowid, a, b FROM t1 ORDER BY rowid} db2
37 } {1 2 2 2 4 4}
39 do_test 1.2 {
40   db2 close
41   recover db 1 test.db2
42   sqlite3 db2 test.db2
43   execsql { SELECT rowid, a, b FROM t1 ORDER BY rowid} db2
44 } {2 2 2 4 4 4}
45 db2 close
50 finish_test