1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +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

@@ -6590,7 +6590,27 @@ void sqlite3PagerSetCodec(
void *sqlite3PagerGetCodec(Pager *pPager){
return pPager->pCodec;
}
#endif
/*
** This function is called by the wal module when writing page content
** into the log file.
**
** This function returns a pointer to a buffer containing the encrypted
** page content. If a malloc fails, this function may return NULL.
*/
void *sqlite3PagerCodec(PgHdr *pPg){
void *aData = 0;
CODEC2(pPg->pPager, pPg->pData, pPg->pgno, 6, return 0, aData);
return aData;
}
/*
** Return the current pager state
*/
int sqlite3PagerState(Pager *pPager){
return pPager->eState;
}
#endif /* SQLITE_HAS_CODEC */
#ifndef SQLITE_OMIT_AUTOVACUUM
/*
@@ -7145,19 +7165,4 @@ int sqlite3PagerWalFramesize(Pager *pPager){
}
#endif
#ifdef SQLITE_HAS_CODEC
/*
** This function is called by the wal module when writing page content
** into the log file.
**
** This function returns a pointer to a buffer containing the encrypted
** page content. If a malloc fails, this function may return NULL.
*/
void *sqlite3PagerCodec(PgHdr *pPg){
void *aData = 0;
CODEC2(pPg->pPager, pPg->pData, pPg->pgno, 6, return 0, aData);
return aData;
}
#endif /* SQLITE_HAS_CODEC */
#endif /* SQLITE_OMIT_DISKIO */