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);