From 9428ef0ed2df48242417ae3e7e6ec8ef079e9f6a Mon Sep 17 00:00:00 2001 From: Stephen Lombardo Date: Tue, 5 Mar 2019 10:57:06 -0500 Subject: [PATCH] add test to verify temp tables --- test/sqlcipher-core.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/sqlcipher-core.test b/test/sqlcipher-core.test index 876423d..63ba1b1 100644 --- a/test/sqlcipher-core.test +++ b/test/sqlcipher-core.test @@ -74,6 +74,23 @@ do_test will-open-with-correct-derived-key { db close file delete -force test.db +# set an encryption key (non-hex) and create +# temp tables, verify you can read from +# sqlite_temp_master +setup test.db "'testkey'" +do_test test-temp-master { + sqlite_orig db test.db + execsql { + PRAGMA key = 'testkey'; + CREATE TEMPORARY TABLE temp_t1(a,b); + INSERT INTO temp_t1(a,b) VALUES ('test1', 'test2'); + SELECT name FROM sqlite_temp_master WHERE type='table'; + SELECT * from temp_t1; + } +} {temp_t1 test1 test2} +db close +file delete -force test.db + # verify that a when a standard database is encrypted the first # 16 bytes are not "SQLite format 3\0" do_test test-sqlcipher-header-overwrite {