From eeaf77af36e974872274b1b8f686a574e1af6618 Mon Sep 17 00:00:00 2001 From: Nick Parker Date: Fri, 23 Aug 2013 16:15:21 -0500 Subject: [PATCH] Add tests around rekey using WAL mode --- test/crypto.test | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/crypto.test b/test/crypto.test index 59e5d9e..8ea1081 100644 --- a/test/crypto.test +++ b/test/crypto.test @@ -413,6 +413,46 @@ do_test rekey-delete-and-query-wal-3 { db close file delete -force test.db +do_test rekey-with-wal-mode-enabled-same-password { + sqlite_orig db test.db + execsql { + PRAGMA key = 'test'; + PRAGMA journal_mode = WAL; + create table t1(a,b); + insert into t1(a,b) values('one for the money', 'two for the show'); + PRAGMA rekey = 'test'; + } + db close + + sqlite_orig db test.db + execsql { + PRAGMA key = 'test'; + select count(*) from t1; + } +} {1} +db close +file delete -force test.db + +do_test rekey-with-wal-mode-enabled-different-password { + sqlite_orig db test.db + execsql { + PRAGMA key = 'test'; + PRAGMA journal_mode = WAL; + create table t1(a,b); + insert into t1(a,b) values('one for the money', 'two for the show'); + PRAGMA rekey = 'testkey'; + } + db close + + sqlite_orig db test.db + execsql { + PRAGMA key = 'testkey'; + select count(*) from t1; + } +} {1} +db close +file delete -force test.db + # attach an encrypted database # where both database have the same # key