From f844a5dfc3f99623a2b9e65c7e0a5853fbe160d1 Mon Sep 17 00:00:00 2001 From: Nick Parker Date: Mon, 29 Jul 2013 11:04:29 -0500 Subject: [PATCH] Attach new codec before btree copy --- src/crypto_impl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto_impl.c b/src/crypto_impl.c index e2df79f..fed1398 100644 --- a/src/crypto_impl.c +++ b/src/crypto_impl.c @@ -979,8 +979,9 @@ int sqlcipher_codec_ctx_migrate(codec_ctx *ctx) { assert( 1==sqlite3BtreeIsInTrans(pDest) ); assert( 1==sqlite3BtreeIsInTrans(pSrc) ); + sqlite3CodecGetKey(db, db->nDb - 1, (void**)&key, &password_sz); - sqlcipher_codec_ctx_set_pass(ctx, key, password_sz, 2); + sqlite3CodecAttach(db, 0, key, password_sz); int i = 0; for(i=0; inChange = saved_nChange; db->nTotalChange = saved_nTotalChange; db->xTrace = saved_xTrace; - sqlite3BtreeSetPageSize(pDest, -1, -1, 1); db->autoCommit = 1; if( pDb ){ sqlite3BtreeClose(pDb->pBt);