*/
#define fts5LeafIsTermless(x) ((x)->szLeaf >= (x)->nn)
-#define fts5LeafFirstTermOff(x) (fts5GetU16(&x->p[(x)->szLeaf]))
+#define fts5LeafFirstTermOff(x) (fts5GetU16(&(x)->p[(x)->szLeaf]))
+#define fts5LeafFirstRowidOff(x) (fts5GetU16((x)->p))
/*
** poslist:
if( p->rc==SQLITE_OK ){
u8 *a = pIter->pLeaf->p;
- pIter->iLeafOffset = fts5GetU16(&a[pIter->pLeaf->szLeaf]);
- assert( pIter->iLeafOffset==4 );
+ pIter->iLeafOffset = 4;
+ assert( fts5LeafFirstTermOff(pIter->pLeaf)==4 );
fts5SegIterLoadTerm(p, pIter, 0);
fts5SegIterLoadNPos(p, pIter);
}
pLeaf = pIter->pLeaf;
if( pLeaf==0 ) break;
ASSERT_SZLEAF_OK(pLeaf);
- if( (iOff = fts5GetU16(&pLeaf->p[0])) && iOff<pLeaf->szLeaf ){
+ if( (iOff = fts5LeafFirstRowidOff(pLeaf)) && iOff<pLeaf->szLeaf ){
iOff += sqlite3Fts5GetVarint(&pLeaf->p[iOff], (u64*)&pIter->iRowid);
pIter->iLeafOffset = iOff;
}
else if( pLeaf->nn>pLeaf->szLeaf ){
- iOff = fts5GetU16(&pLeaf->p[pLeaf->szLeaf]);
+ iOff = fts5LeafFirstTermOff(pLeaf);
pIter->iLeafOffset = iOff;
bNewTerm = 1;
}
Fts5Data *pNew = fts5DataRead(p, iAbs);
if( pNew ){
int iRowid, bTermless;
- iRowid = fts5GetU16(pNew->p);
+ iRowid = fts5LeafFirstRowidOff(pNew);
bTermless = fts5LeafIsTermless(pNew);
if( iRowid ){
SWAPVAL(Fts5Data*, pNew, pLast);
assert( p->rc==SQLITE_OK );
assert( pIter->pLeaf );
- iOff = fts5GetU16(&a[n]);
+ iOff = fts5LeafFirstTermOff(pIter->pLeaf);
if( iOff<4 || iOff>=n ){
p->rc = FTS5_CORRUPT;
return;
u8 *a = pIter->pLeaf->p;
int n = pIter->pLeaf->szLeaf;
- iOff = fts5GetU16(&a[0]);
+ iOff = fts5LeafFirstRowidOff(pIter->pLeaf);
if( iOff<4 || iOff>=n ){
p->rc = FTS5_CORRUPT;
}else{
Fts5Data *pLeaf = fts5DataRead(p, FTS5_SEGMENT_ROWID(pSeg->iSegid, 0, i));
if( pLeaf ){
if( !fts5LeafIsTermless(pLeaf) ) p->rc = FTS5_CORRUPT;
- if( i>=iNoRowid && 0!=fts5GetU16(&pLeaf->p[0]) ) p->rc = FTS5_CORRUPT;
+ if( i>=iNoRowid && 0!=fts5LeafFirstRowidOff(pLeaf) ) p->rc = FTS5_CORRUPT;
}
fts5DataRelease(pLeaf);
if( p->rc ) break;
int res; /* Comparison of term and split-key */
iOff = fts5LeafFirstTermOff(pLeaf);
- iRowidOff = fts5GetU16(&pLeaf->p[0]);
+ iRowidOff = fts5LeafFirstRowidOff(pLeaf);
if( iRowidOff>=iOff ){
p->rc = FTS5_CORRUPT;
}else{
iKey = FTS5_SEGMENT_ROWID(iSegid, 0, iPg);
pLeaf = fts5DataRead(p, iKey);
if( pLeaf ){
- if( fts5GetU16(&pLeaf->p[0])!=0 ) p->rc = FTS5_CORRUPT;
+ if( fts5LeafFirstRowidOff(pLeaf)!=0 ) p->rc = FTS5_CORRUPT;
fts5DataRelease(pLeaf);
}
}
pLeaf = fts5DataRead(p, iKey);
if( pLeaf ){
i64 iRowid;
- int iRowidOff = fts5GetU16(&pLeaf->p[0]);
+ int iRowidOff = fts5LeafFirstRowidOff(pLeaf);
ASSERT_SZLEAF_OK(pLeaf);
if( iRowidOff>=pLeaf->szLeaf ){
p->rc = FTS5_CORRUPT;
-C Experiment\swith\sa\sdifferent\sfts5\sleaf\spage\sformat\sthat\sallows\sfaster\sseeks.
-D 2015-09-05T19:52:08.105
+C Use\smacros\sto\smake\sthe\scode\sin\sfts5_index.c\seasier\sto\sread.
+D 2015-09-07T08:14:30.857
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in f85066ce844a28b671aaeeff320921cd0ce36239
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F ext/fts5/fts5_config.c 80b61fd2c6844b64a3e72a64572d50a812da9384
F ext/fts5/fts5_expr.c 1c24e1a2ffb286bfe37e537a43b7fadabfe993d4
F ext/fts5/fts5_hash.c 4bf4b99708848357b8a2b5819e509eb6d3df9246
-F ext/fts5/fts5_index.c c34a64666c3b573aaed0fe103ce739ca2c0b88e5
+F ext/fts5/fts5_index.c 213e5aea27100a2ebb7a576d6574bcc28c594520
F ext/fts5/fts5_main.c e9d0892424bb7f0a8b58613d4ff75cb650cf286e
F ext/fts5/fts5_storage.c 120f7b143688b5b7710dacbd48cff211609b8059
F ext/fts5/fts5_tcl.c 6da58d6e8f42a93c4486b5ba9b187a7f995dee37
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 24924a58197e558a9e8800cc5c91dc8fb32f3557
-R 00e6b769eaa54af1e95eef69109c890a
-T *branch * fts5-incompatible
-T *sym-fts5-incompatible *
-T -sym-trunk *
+P a1f4c3b543eed84e808f6b901a38179786fffe16
+R d9f9c87817152716ded47406f74ba235
U dan
-Z 9f2973699597cf834c49e709dc04f160
+Z 4c8df884c6ae97a50d0e8662a6ca4b0e