SQLite

Check-in [70815e27]
Login

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

Overview
Comment:Fix a spurious report of corruption from the fts3/4 integrity-check triggered by using the languageid option.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 70815e273f511481c310dc33b3b49079901d891078fad49b663fbce06c77ecc2
User & Date: dan 2019-12-21 20:43:34
Context
2019-12-22
14:29
Fix "PRAGMA data_version" so that it works the same way with locking_mode=PERSIST and journal_mode=PERSIST configured. Fix for 7a458c2a5f. (check-in: 45748e2d user: dan tags: trunk)
2019-12-21
20:43
Fix a spurious report of corruption from the fts3/4 integrity-check triggered by using the languageid option. (check-in: 70815e27 user: dan tags: trunk)
19:37
When creating a new virtual table, ensure that the OP_ParseSchema opcode processes the correct entry in the sqlite_master table even if there is a second entry with the same name and table values due to database corruption and the use of writable_schema=ON. Dbsqlfuzz find. (check-in: 4dbb6e1c user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3.c.

2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970

  /* If iLevel is less than 0 and this is not a scan, include a seg-reader 
  ** for the pending-terms. If this is a scan, then this call must be being
  ** made by an fts4aux module, not an FTS table. In this case calling
  ** Fts3SegReaderPending might segfault, as the data structures used by 
  ** fts4aux are not completely populated. So it's easiest to filter these
  ** calls out here.  */
  if( iLevel<0 && p->aIndex ){
    Fts3SegReader *pSeg = 0;
    rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg);
    if( rc==SQLITE_OK && pSeg ){
      rc = fts3SegReaderCursorAppend(pCsr, pSeg);
    }
  }








|







2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970

  /* If iLevel is less than 0 and this is not a scan, include a seg-reader 
  ** for the pending-terms. If this is a scan, then this call must be being
  ** made by an fts4aux module, not an FTS table. In this case calling
  ** Fts3SegReaderPending might segfault, as the data structures used by 
  ** fts4aux are not completely populated. So it's easiest to filter these
  ** calls out here.  */
  if( iLevel<0 && p->aIndex && p->iPrevLangid==iLangid ){
    Fts3SegReader *pSeg = 0;
    rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg);
    if( rc==SQLITE_OK && pSeg ){
      rc = fts3SegReaderCursorAppend(pCsr, pSeg);
    }
  }

Changes to test/fts4langid.test.

485
486
487
488
489
490
491















492
  } {1 2 5}

  do_execsql_test 5.4.$lid.5 {
    SELECT count(*) FROM t6_segdir;
    SELECT count(*) FROM t6_segments;
  } {1 2}
}















finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
  } {1 2 5}

  do_execsql_test 5.4.$lid.5 {
    SELECT count(*) FROM t6_segdir;
    SELECT count(*) FROM t6_segments;
  } {1 2}
}

reset_db
do_execsql_test 6.0 {
  CREATE VIRTUAL TABLE vt0 USING fts4(c0, languageid="lid");
  INSERT INTO vt0 VALUES ('a'), ('b');
  BEGIN;
    UPDATE vt0 SET lid = 1 WHERE lid=0;
}
do_execsql_test 6.1 {
  INSERT INTO vt0(vt0) VALUES('integrity-check');
}
do_execsql_test 6.2 {
  COMMIT;
  INSERT INTO vt0(vt0) VALUES('integrity-check');
}
finish_test