From: dan Date: Mon, 18 Jan 2016 09:08:56 +0000 (+0000) Subject: Add a debugging function to print human-readable versions of fts5 detail=none leaf... X-Git-Tag: version-3.11.0~129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0536a07c0efb1b3bf3ba3371ede382d129d1bad4;p=thirdparty%2Fsqlite.git Add a debugging function to print human-readable versions of fts5 detail=none leaf pages. FossilOrigin-Name: 8358af3658d888516cdef5f8c8d89e9bdee53f91 --- diff --git a/ext/fts5/fts5_index.c b/ext/fts5/fts5_index.c index d5ea972414..3d4488aedf 100644 --- a/ext/fts5/fts5_index.c +++ b/ext/fts5/fts5_index.c @@ -5904,6 +5904,47 @@ static int fts5DecodeDoclist(int *pRc, Fts5Buffer *pBuf, const u8 *a, int n){ return iOff; } +/* +** This function is part of the fts5_decode() debugging function. It is +** only ever used with detail=none tables. +** +** Buffer (pData/nData) contains a doclist in the format used by detail=none +** tables. This function appends a human-readable version of that list to +** buffer pBuf. +** +** If *pRc is other than SQLITE_OK when this function is called, it is a +** no-op. If an OOM or other error occurs within this function, *pRc is +** set to an SQLite error code before returning. The final state of buffer +** pBuf is undefined in this case. +*/ +static void fts5DecodeRowidList( + int *pRc, /* IN/OUT: Error code */ + Fts5Buffer *pBuf, /* Buffer to append text to */ + const u8 *pData, int nData /* Data to decode list-of-rowids from */ +){ + int i = 0; + i64 iRowid = 0; + + while( i