/ Check-in [fed79bee]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Don't store empty segments. When inserting empty strings, the code was writing out a segment made up of a single leaf node containing the \0 header. LeafReader assumed that leaf nodes always contained at least one term, so assertions would fail.

While it would be possible to support reading and merging empty segments, there's no reason to do so. While this change could have been done in writeZeroSegment(), I put it in leafWriterFlush() so that it would work right if segmentMerge() created an empty segment, which could happen with future changes to how deleted documents are handled. (CVS 3484)

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fed79beec7da24a26ae94494bdc0c98dd102bc06
User & Date: shess 2006-10-25 05:21:55
Context
2006-10-25
20:27
Test to force edge cases in query logic. Basically, exercise code to handle lack of hits correctly. (CVS 3485) check-in: 2cb59033 user: shess tags: trunk
05:21
Don't store empty segments. When inserting empty strings, the code was writing out a segment made up of a single leaf node containing the \0 header. LeafReader assumed that leaf nodes always contained at least one term, so assertions would fail.

While it would be possible to support reading and merging empty segments, there's no reason to do so. While this change could have been done in writeZeroSegment(), I put it in leafWriterFlush() so that it would work right if segmentMerge() created an empty segment, which could happen with future changes to how deleted documents are handled. (CVS 3484) check-in: fed79bee user: shess tags: trunk

2006-10-19
23:36
dup fts1 tests and edit for fts2. fts1porter.test omitted because it depends on being able to poke through to %_term table. (CVS 3482) check-in: 2806c341 user: shess tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts2/fts2.c.

  3781   3781     sqlite_int64 iEndBlockid;
  3782   3782     char *pRootInfo;
  3783   3783     int rc, nRootInfo;
  3784   3784   
  3785   3785     rc = leafWriterRootInfo(v, pWriter, &pRootInfo, &nRootInfo, &iEndBlockid);
  3786   3786     if( rc!=SQLITE_OK ) return rc;
  3787   3787   
         3788  +  /* Don't bother storing an entirely empty segment. */
         3789  +  if( iEndBlockid==0 && nRootInfo==1 ) return SQLITE_OK;
         3790  +
  3788   3791     return segdir_set(v, pWriter->iLevel, pWriter->idx,
  3789   3792                       pWriter->iStartBlockid, pWriter->iEndBlockid,
  3790   3793                       iEndBlockid, pRootInfo, nRootInfo);
  3791   3794   }
  3792   3795   
  3793   3796   static void leafWriterDestroy(LeafWriter *pWriter){
  3794   3797     if( pWriter->has_parent ) interiorWriterDestroy(&pWriter->parentWriter);