Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix gcc gripe about parens in a ||/&& in mergePosList(). Drop unused pBlob/nBlob in index_insert_term(). Fix NULL deref in an assertion in docListUpdate() delete case. Minor code tightening in docListUpdate(). (CVS 3367) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a6fcf9101a831bf5f129c6045eabf303 |
User & Date: | shess 2006-08-25 19:20:26.000 |
Context
2006-08-25
| ||
23:42 | Add support for INSERT INTO ... DEFAULT VALUES. Tickets #299, #1940. (CVS 3368) (check-in: bc84cb54b0 user: drh tags: trunk) | |
19:20 | Fix gcc gripe about parens in a ||/&& in mergePosList(). Drop unused pBlob/nBlob in index_insert_term(). Fix NULL deref in an assertion in docListUpdate() delete case. Minor code tightening in docListUpdate(). (CVS 3367) (check-in: a6fcf9101a user: shess tags: trunk) | |
2006-08-24
| ||
15:18 | Documentation updates for the new SQLITE_FUNCTION authorization. (CVS 3366) (check-in: e029637e54 user: drh tags: trunk) | |
Changes
Changes to ext/fts1/fulltext.c.
︙ | ︙ | |||
290 291 292 293 294 295 296 | * otherwise pUpdate, which must contain only the single docid [iDocid], is * inserted (if not present) or updated (if already present). */ static int docListUpdate(DocList *d, sqlite_int64 iDocid, DocList *pUpdate){ int modified = 0; DocListReader reader; char *p; | < > | < | < < < | | | < | | 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | * otherwise pUpdate, which must contain only the single docid [iDocid], is * inserted (if not present) or updated (if already present). */ static int docListUpdate(DocList *d, sqlite_int64 iDocid, DocList *pUpdate){ int modified = 0; DocListReader reader; char *p; if( pUpdate!=NULL ){ assert( d->iType==pUpdate->iType); assert( iDocid==firstDocid(pUpdate) ); } readerInit(&reader, d); while( !readerAtEnd(&reader) && peekDocid(&reader)<iDocid ){ skipDocument(&reader); } p = reader.p; /* Delete if there is a matching element. */ if( !readerAtEnd(&reader) && iDocid==peekDocid(&reader) ){ skipDocument(&reader); memmove(p, reader.p, docListEnd(d) - reader.p); d->nData -= (reader.p - p); modified = 1; } /* Insert if indicated. */ if( pUpdate!=NULL ){ int iDoclist = p-d->pData; docListAddEndPos(pUpdate); d->pData = realloc(d->pData, d->nData+pUpdate->nData); p = d->pData + iDoclist; memmove(p+pUpdate->nData, p, docListEnd(d) - p); memcpy(p, pUpdate->pData, pUpdate->nData); d->nData += pUpdate->nData; modified = 1; } return modified; } /* Split the second half of doclist d into a separate doclist d2. Returns 1 |
︙ | ︙ | |||
409 410 411 412 413 414 415 | match = 1; } if( m->pOut->iType >= DL_POSITIONS ){ docListAddPos(m->pOut, in_pos); } block_pos = readPosition(pBlockReader); in_pos = readPosition(&m->in); | | | 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | match = 1; } if( m->pOut->iType >= DL_POSITIONS ){ docListAddPos(m->pOut, in_pos); } block_pos = readPosition(pBlockReader); in_pos = readPosition(&m->in); } else if( in_pos==-1 || (block_pos!=-1 && block_pos-m->iOffset<in_pos) ){ block_pos = readPosition(pBlockReader); } else { in_pos = readPosition(&m->in); } } if( m->pOut->iType >= DL_POSITIONS && match ){ docListAddEndPos(m->pOut); |
︙ | ︙ | |||
1334 1335 1336 1337 1338 1339 1340 | } /* Update the %_terms table to map the term [zTerm] to the given rowid. */ static int index_insert_term(fulltext_vtab *v, const char *zTerm, int nTerm, sqlite_int64 iDocid, DocList *p){ sqlite_int64 iFirst; sqlite_int64 iIndexRow; DocList doclist; | < < | 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 | } /* Update the %_terms table to map the term [zTerm] to the given rowid. */ static int index_insert_term(fulltext_vtab *v, const char *zTerm, int nTerm, sqlite_int64 iDocid, DocList *p){ sqlite_int64 iFirst; sqlite_int64 iIndexRow; DocList doclist; int rc = term_chunk_select(v, zTerm, nTerm, iDocid, &iFirst); if( rc==SQLITE_DONE ){ docListInit(&doclist, DL_POSITIONS_OFFSETS, 0, 0); if( docListUpdate(&doclist, iDocid, p) ){ rc = term_insert(v, zTerm, nTerm, iDocid, &doclist); docListDestroy(&doclist); |
︙ | ︙ |