1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Updates to the Codec interface to support codecs on attached databases and

to allow rekeying in the middle of a transaction.  These changes are only 
applicable if SQLite is compiled with SQLITE_HAS_CODEC.

FossilOrigin-Name: d5b084e9d8cfe9c0c339aca076d472bb50aa764c
This commit is contained in:
drh
2013-05-29 17:48:28 +00:00
parent ba4f01edb3
commit ee0231ef52
5 changed files with 45 additions and 30 deletions

View File

@@ -1771,10 +1771,10 @@ void sqlite3Pragma(
#ifdef SQLITE_HAS_CODEC
if( sqlite3StrICmp(zLeft, "key")==0 && zRight ){
sqlite3_key(db, zRight, sqlite3Strlen30(zRight));
sqlite3_key_v2(db, zDb, zRight, sqlite3Strlen30(zRight));
}else
if( sqlite3StrICmp(zLeft, "rekey")==0 && zRight ){
sqlite3_rekey(db, zRight, sqlite3Strlen30(zRight));
sqlite3_rekey_v2(db, zDb, zRight, sqlite3Strlen30(zRight));
}else
if( zRight && (sqlite3StrICmp(zLeft, "hexkey")==0 ||
sqlite3StrICmp(zLeft, "hexrekey")==0) ){
@@ -1786,9 +1786,9 @@ void sqlite3Pragma(
zKey[i/2] = (h2 & 0x0f) | ((h1 & 0xf)<<4);
}
if( (zLeft[3] & 0xf)==0xb ){
sqlite3_key(db, zKey, i/2);
sqlite3_key_v2(db, zDb, zKey, i/2);
}else{
sqlite3_rekey(db, zKey, i/2);
sqlite3_rekey_v2(db, zDb, zKey, i/2);
}
}else
#endif