/ Check-in [d0e943d9]
Login

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

Overview
Comment:Fix another potential buffer overread in fts5.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d0e943d9574c7cab1af4a0fe753a0b5f91ea0e884b91a85b13239144b71f067c
User & Date: dan 2019-01-07 16:52:00
Context
2019-01-08
08:02
Fix further problems with fts5 and corrupt databases causing integer overflow. check-in: 673a7dd6 user: dan tags: trunk
2019-01-07
16:52
Fix another potential buffer overread in fts5. check-in: d0e943d9 user: dan tags: trunk
15:57
For SQLITE_ENABLE_PREUPDATE_HOOK builds, disable the optimization for a REPLACE command on a WITHOUT ROWID table with no indexes, triggers or foreign key constraints that causes SQLite to clobber any existing row without separately checking for it. This optimization causes SQLite to omit the expected pre-update-hook callbacks. check-in: 6281ef97 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts5/fts5_hash.c.

   479    479   ){
   480    480     unsigned int iHash = fts5HashKey(pHash->nSlot, (const u8*)pTerm, nTerm);
   481    481     char *zKey = 0;
   482    482     Fts5HashEntry *p;
   483    483   
   484    484     for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){
   485    485       zKey = fts5EntryKey(p);
   486         -    if( memcmp(zKey, pTerm, nTerm)==0 && zKey[nTerm]==0 ) break;
          486  +    assert( p->nKey+1==(int)strlen(zKey) );
          487  +    if( nTerm==p->nKey+1 && memcmp(zKey, pTerm, nTerm)==0 ) break;
   487    488     }
   488    489   
   489    490     if( p ){
   490    491       fts5HashAddPoslistSize(pHash, p);
   491    492       *ppDoclist = (const u8*)&zKey[nTerm+1];
   492    493       *pnDoclist = p->nData - (sizeof(Fts5HashEntry) + nTerm + 1);
   493    494     }else{

Changes to ext/fts5/test/fts5corrupt3.test.

  2519   2519     INSERT INTO t1(t1) VALUES('rebuild');
  2520   2520   } {1 {database disk image is malformed}}
  2521   2521   
  2522   2522   do_execsql_test 25.2 {
  2523   2523     PRAGMA page_size=512;
  2524   2524   } 
  2525   2525   
         2526  +#--------------------------------------------------------------------------
         2527  +reset_db
         2528  +do_test 26.0 {
         2529  +  sqlite3 db {}
         2530  +  db deserialize [decode_hexdb {
         2531  +| size 32768 pagesize 4096 filename c30b.db
         2532  +| page 1 offset 0
         2533  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         2534  +|     16: 10 00 01 01 00 40 20 20 00 00 00 01 00 00 00 08   .....@  ........
         2535  +|     32: 00 00 00 02 00 00 00 01 00 00 00 01 00 00 00 04   ................
         2536  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00   ................
         2537  +|     80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01   ................
         2538  +|     96: 00 2e 30 38 0d 0f c7 00 07 0d 92 00 0f 8d 0f 36   ..08...........6
         2539  +|    112: 0e cb 0e 6b 0e 0e 0d b6 0d 92 0d 92 00 00 00 00   ...k............
         2540  +|   3472: 00 00 22 08 06 17 11 11 01 31 74 61 62 6c 65 74   .........1tablet
         2541  +|   3488: 32 74 32 08 43 52 45 41 54 45 20 54 41 42 4c 45   2t2.CREATE TABLE
         2542  +|   3504: 20 74 32 28 78 29 56 07 06 17 1f 1f 01 7d 74 61    t2(x)V.......ta
         2543  +|   3520: 62 6c 65 74 31 5f 63 6f 6e 66 69 67 74 31 5f 63   blet1_configt1_c
         2544  +|   3536: 6f 6e 66 69 67 07 43 52 45 41 54 45 20 54 41 42   onfig.CREATE TAB
         2545  +|   3552: 4c 45 20 27 74 31 5f 63 6f 6e 66 69 67 27 28 6b   LE 't1_config'(k
         2546  +|   3568: 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 76 29    PRIMARY KEY, v)
         2547  +|   3584: 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44 5b 06    WITHOUT ROWID[.
         2548  +|   3600: 07 17 21 21 01 81 01 74 61 62 6c 65 74 31 5f 64   ..!!...tablet1_d
         2549  +|   3616: 6f 63 73 69 7a 65 74 31 5f 64 6f 63 73 69 7a 65   ocsizet1_docsize
         2550  +|   3632: 06 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 74   .CREATE TABLE 't
         2551  +|   3648: 31 5f 64 6f 63 73 69 7a 65 27 28 69 64 20 49 4e   1_docsize'(id IN
         2552  +|   3664: 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45   TEGER PRIMARY KE
         2553  +|   3680: 59 2c 20 73 7a 20 42 4c 4f 42 29 5e 05 07 17 21   Y, sz BLOB)^...!
         2554  +|   3696: 21 01 81 07 74 61 62 6c 65 74 31 5f 63 6f 6e 74   !...tablet1_cont
         2555  +|   3712: 65 6e 74 74 31 5f 63 6f 6e 74 65 6e 74 05 43 52   entt1_content.CR
         2556  +|   3728: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 63   EATE TABLE 't1_c
         2557  +|   3744: 6f 6e 74 65 6e 74 27 28 69 64 20 49 4e 54 45 47   ontent'(id INTEG
         2558  +|   3760: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20   ER PRIMARY KEY, 
         2559  +|   3776: 63 30 2c 20 63 31 2c 20 63 32 29 69 04 07 17 19   c0, c1, c2)i....
         2560  +|   3792: 19 01 81 2d 74 61 62 6c 65 74 31 5f 69 64 78 74   ...-tablet1_idxt
         2561  +|   3808: 31 5f 69 64 78 04 43 52 45 41 54 45 20 54 41 42   1_idx.CREATE TAB
         2562  +|   3824: 4c 45 20 27 74 31 5f 69 64 78 27 28 73 65 67 69   LE 't1_idx'(segi
         2563  +|   3840: 64 2c 20 74 65 72 6d 2c 20 70 67 6e 6f 2c 20 50   d, term, pgno, P
         2564  +|   3856: 52 49 4d 41 52 59 20 4b 45 59 28 73 65 67 69 64   RIMARY KEY(segid
         2565  +|   3872: 2c 20 74 65 72 6d 29 29 20 57 49 54 48 4f 55 54   , term)) WITHOUT
         2566  +|   3888: 20 52 4f 57 49 44 55 03 07 17 1b 1b 01 81 01 74    ROWIDU........t
         2567  +|   3904: 61 62 6c 65 74 31 5f 64 61 74 61 74 31 5f 64 61   ablet1_datat1_da
         2568  +|   3920: 74 61 03 43 52 45 41 54 45 20 54 41 42 4c 45 20   ta.CREATE TABLE 
         2569  +|   3936: 27 74 31 5f 64 61 74 61 27 28 69 64 20 49 4e 54   't1_data'(id INT
         2570  +|   3952: 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59   EGER PRIMARY KEY
         2571  +|   3968: 2c 20 62 6c 6f 63 6b 20 42 4c 4f 42 29 38 02 06   , block BLOB)8..
         2572  +|   3984: 17 11 11 08 5f 74 61 62 6c 65 74 31 74 31 43 52   ...._tablet1t1CR
         2573  +|   4000: 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41 42   EATE VIRTUAL TAB
         2574  +|   4016: 4c 45 20 74 31 20 55 53 49 4e 47 20 66 74 73 35   LE t1 USING fts5
         2575  +|   4032: 28 61 2c 62 2c 63 29 00 00 00 39 00 00 00 00 00   (a,b,c)...9.....
         2576  +| page 3 offset 8192
         2577  +|      0: 0d 0c 0f 00 05 09 fe 00 0f e6 09 fe 0c 94 0c 23   ...............#
         2578  +|     16: 0a 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
         2579  +|   2544: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 15 0a   ................
         2580  +|   2560: 03 00 30 00 00 00 00 01 03 03 00 03 01 01 01 02   ..0.............
         2581  +|   2576: 01 01 03 01 01 83 72 8c 80 80 80 80 01 04 00 87   ......r.........
         2582  +|   2592: 68 00 00 01 e4 02 30 30 03 03 06 02 83 0f 30 30   h.....00......00
         2583  +|   2608: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2584  +|   2624: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2585  +|   2640: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2586  +|   2656: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2587  +|   2672: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2588  +|   2688: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2589  +|   2704: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2590  +|   2720: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2591  +|   2736: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2592  +|   2752: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2593  +|   2768: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2594  +|   2784: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2595  +|   2800: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2596  +|   2816: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2597  +|   2832: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2598  +|   2848: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2599  +|   2864: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2600  +|   2880: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2601  +|   2896: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2602  +|   2912: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2603  +|   2928: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2604  +|   2944: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2605  +|   2960: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2606  +|   2976: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2607  +|   2992: 30 30 30 30 30 30 30 30 30 30 30 30 30 03 06 01   0000000000000...
         2608  +|   3008: 01 03 01 08 32 30 31 36 30 36 30 39 03 03 07 01   ....20160609....
         2609  +|   3024: 01 34 03 03 05 01 01 35 03 03 04 01 06 62 69 6e   .4.....5.....bin
         2610  +|   3040: 61 72 79 03 07 01 02 02 01 08 63 6f 6d 70 69 6c   ary.......compil
         2611  +|   3056: 65 72 03 03 02 01 03 67 63 63 03 03 03 01 01 78   er.....gcc.....x
         2612  +|   3072: 03 07 01 01 02 04 06 83 17 0d 06 06 0d 0d 08 0f   ................
         2613  +|   3088: ef 00 14 2a 00 00 00 00 01 02 02 00 02 01 01 01   ...*............
         2614  +|   3104: 02 01 01 6a 88 80 80 80 80 01 04 00 81 58 00 00   ...j.........X..
         2615  +|   3120: 00 5f 07 30 62 69 6e 61 72 79 0c 01 03 01 01 06   ._.0binary......
         2616  +|   3136: 65 6e 61 62 6c 65 0a 01 01 01 01 01 01 01 01 01   enable..........
         2617  +|   3152: 01 01 01 04 66 74 73 34 0a 01 01 01 01 01 04 01   ....fts4........
         2618  +|   3168: 35 0d 01 01 01 01 01 01 06 6e 6f 63 61 73 65 0b   5........nocase.
         2619  +|   3184: 01 03 01 01 05 72 74 72 69 6d 0a 01 03 01 01 01   .....rtrim......
         2620  +|   3200: 78 0a 01 01 01 01 01 01 01 01 01 01 01 04 0c 14   x...............
         2621  +|   3216: 0c 09 0c 0b 86 4a 84 80 80 80 80 01 04 00 8d 18   .....J..........
         2622  +|   3232: 00 00 03 2b 02 30 30 01 02 06 01 02 06 01 02 06   ...+.00.........
         2623  +|   3248: 1f 02 03 01 02 03 01 02 03 01 08 32 30 31 36 30   ...........20160
         2624  +|   3264: 36 30 39 01 02 07 01 02 07 01 02 07 01 01 34 01   609...........4.
         2625  +|   3280: 02 05 01 02 05 01 02 05 01 01 35 01 02 04 01 02   ..........5.....
         2626  +|   3296: 04 01 02 04 02 07 30 30 30 30 30 30 30 1c 02 04   ......0000000...
         2627  +|   3312: 01 02 04 01 02 04 01 06 62 69 6e 61 72 79 03 06   ........binary..
         2628  +|   3328: 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01   ................
         2629  +|   3344: 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02   ................
         2630  +|   3360: 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02 02   ................
         2631  +|   3376: 03 06 01 02 02 03 06 01 02 02 01 08 63 6f 6d 70   ............comp
         2632  +|   3392: 69 6c 65 72 01 02 02 01 02 02 01 02 02 01 06 64   iler...........d
         2633  +|   3408: 62 73 74 61 74 07 02 03 01 02 03 01 02 03 02 04   bstat...........
         2634  +|   3424: 65 62 75 67 04 02 02 01 02 02 01 02 02 01 06 65   ebug...........e
         2635  +|   3440: 6e 61 62 6c 65 07 02 02 01 02 02 01 02 02 01 02   nable...........
         2636  +|   3456: 02 01 02 02 01 02 02 01 02 02 01 02 02 01 02 02   ................
         2637  +|   3472: 01 02 02 01 02 02 01 02 02 01 02 02 01 02 02 01   ................
         2638  +|   3488: 02 02 01 02 02 01 02 02 01 02 02 01 02 02 01 02   ................
         2639  +|   3504: 02 01 02 02 02 08 78 74 65 6e 73 69 6f 6e 1f 02   ......xtension..
         2640  +|   3520: 04 01 02 04 01 02 04 01 04 66 74 73 34 0a 02 03   .........fts4...
         2641  +|   3536: 01 02 03 01 02 03 04 01 35 0d 02 03 01 02 03 01   ........5.......
         2642  +|   3552: 02 03 01 03 67 63 63 01 02 03 01 02 03 01 02 03   ....gcc.........
         2643  +|   3568: 02 06 65 6f 70 6f 6c 79 10 02 03 01 02 03 01 02   ..eopoly........
         2644  +|   3584: 03 01 05 6a 73 6f 6e 31 13 02 03 01 02 03 01 02   ...json1........
         2645  +|   3600: 03 01 04 6c 6f 61 64 1f 02 03 01 02 03 01 02 03   ...load.........
         2646  +|   3616: 01 03 6d 61 78 1c 02 02 01 02 02 01 02 02 02 05   ..max...........
         2647  +|   3632: 65 6d 6f 72 79 1c 02 03 01 02 03 01 02 03 04 04   emory...........
         2648  +|   3648: 73 79 73 35 16 02 03 01 02 03 01 02 03 01 06 6e   sys5...........n
         2649  +|   3664: 6f 63 61 73 65 02 06 01 02 02 03 06 01 02 02 03   ocase...........
         2650  +|   3680: 06 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06   ................
         2651  +|   3696: 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01   ................
         2652  +|   3712: 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02   ................
         2653  +|   3728: 02 01 04 6f 6d 69 74 1f 02 02 01 02 02 01 02 02   ...omit.........
         2654  +|   3744: 01 05 72 74 72 65 65 19 02 03 01 02 03 01 02 03   ..rtree.........
         2655  +|   3760: 04 02 69 6d 01 06 01 02 02 03 06 01 02 02 03 06   ..im............
         2656  +|   3776: 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01   ................
         2657  +|   3792: 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02   ................
         2658  +|   3808: 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02 02   ................
         2659  +|   3824: 01 0a 74 68 72 65 61 64 73 61 66 65 03 57 34 56   ..threadsafe.W4V
         2660  +|   3840: 94 64 91 46 85 84 04 76 74 61 62 07 02 04 01 02   .d.F...vtab.....
         2661  +|   3856: 04 01 02 04 01 01 78 01 06 01 01 02 01 06 01 01   ......x.........
         2662  +|   3872: 02 01 06 01 01 02 01 06 01 01 02 01 06 01 10 02   ................
         2663  +|   3888: 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01   ................
         2664  +|   3904: 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06   ................
         2665  +|   3920: 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01   ................
         2666  +|   3936: 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01   ................
         2667  +|   3952: 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02   ................
         2668  +|   3968: 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01   ................
         2669  +|   3984: 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06   ................
         2670  +|   4000: 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01   ................
         2671  +|   4016: 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01   ................
         2672  +|   4032: 02 01 06 01 01 02 01 06 01 01 02 04 15 13 0c 0c   ................
         2673  +|   4048: 12 44 13 11 0f 47 13 0f 0c 0e 11 10 0f 0e 10 0f   .D...G..........
         2674  +|   4064: 44 0f 10 40 15 0f 07 01 03 00 14 1e 4e 1f 1e 00   D..@........N...
         2675  +|   4080: 00 00 11 24 00 00 00 00 01 01 01 00 01 01 01 01   ...$............
         2676  +| page 4 offset 12288
         2677  +|      0: 0a 00 00 00 03 0f ec 00 0f fa 0f f3 0f ec 00 00   ................
         2678  +|   4064: 00 00 00 00 00 00 00 00 00 00 00 00 06 04 01 0c   ................
         2679  +|   4080: 01 03 02 06 04 01 0c 01 02 02 05 04 09 0c 01 02   ................
         2680  +| page 5 offset 16384
         2681  +|      0: 0d 0e 5b 00 1e 0a 4d 00 0f d8 0f af 0a 4d 0f 74   ..[...M......M.t
         2682  +|     16: 0f 61 0f 4e 0f 2f 0f 0f 0e ef 0e 40 0e 24 0e 08   .a.N./.....@.$..
         2683  +|     32: 0d ef 0d d5 0d bb 0d a0 0d 84 0d 68 0d 4f 0d 35   ...........h.O.5
         2684  +|     48: 0d 1b 0c fb 0c da 0c b9 0c 99 0c 78 0c 57 0c 3e   ...........x.W.>
         2685  +|     64: 0c 24 0c 0a 0c 0a 0c 0a 0c 0a 0c 0a 0c 0a 0c 0a   .$..............
         2686  +|   2624: 00 00 00 00 00 00 00 00 00 00 00 00 00 83 3a 03   ..............:.
         2687  +|   2640: 06 00 43 86 33 19 43 4f 4d 50 49 4c 45 52 3d 67   ..C.3.COMPILER=g
         2688  +|   2656: 63 63 2d 35 2e 34 2e 30 20 32 30 31 36 30 36 30   cc-5.4.0 2016060
         2689  +|   2672: 39 58 27 30 30 30 30 30 30 30 30 30 30 30 30 30   9X'0000000000000
         2690  +|   2688: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2691  +|   2704: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2692  +|   2720: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2693  +|   2736: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2694  +|   2752: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2695  +|   2768: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2696  +|   2784: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2697  +|   2800: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2698  +|   2816: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2699  +|   2832: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2700  +|   2848: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2701  +|   2864: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2702  +|   2880: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2703  +|   2896: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2704  +|   2912: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2705  +|   2928: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2706  +|   2944: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2707  +|   2960: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2708  +|   2976: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2709  +|   2992: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2710  +|   3008: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2711  +|   3024: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2712  +|   3040: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2713  +|   3056: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30   0000000000000000
         2714  +|   3072: 30 30 30 27 42 49 4e 41 52 59 18 24 05 00 25 0f   000'BINARY.$..%.
         2715  +|   3088: 19 54 48 52 45 41 44 53 41 46 45 3d 30 58 42 49   .THREADSAFE=0XBI
         2716  +|   3104: 4e 41 52 59 18 23 05 00 25 0f 19 54 48 52 45 41   NARY.#..%..THREA
         2717  +|   3120: 44 53 41 46 45 3d 30 58 4e 4f 43 41 53 45 17 22   DSAFE=0XNOCASE..
         2718  +|   3136: 05 00 25 0f 17 54 48 52 45 41 44 53 41 46 45 3d   ..%..THREADSAFE=
         2719  +|   3152: 30 58 52 54 52 49 4d 1f 21 05 00 33 0f 19 4f 4d   0XRTRIM.!..3..OM
         2720  +|   3168: 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49 4f   IT LOAD EXTENSIO
         2721  +|   3184: 4e 58 42 49 4e 41 52 59 1f 20 05 00 33 0f 19 4f   NXBINARY. ..3..O
         2722  +|   3200: 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49   MIT LOAD EXTENSI
         2723  +|   3216: 4f 4e 58 4e 4f 43 41 53 45 1e 1f 05 00 33 0f 17   ONXNOCASE....3..
         2724  +|   3232: 4f 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53   OMIT LOAD EXTENS
         2725  +|   3248: 49 4f 4e 58 52 54 52 49 4d 1f 1e 05 00 33 0f 19   IONXRTRIM....3..
         2726  +|   3264: 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30 30 30   MAX MEMORY=50000
         2727  +|   3280: 30 30 30 58 42 49 4e 41 52 59 1f 1d 05 00 33 0f   000XBINARY....3.
         2728  +|   3296: 19 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30 30   .MAX MEMORY=5000
         2729  +|   3312: 30 30 30 30 58 4e 4f 43 41 53 45 1e 1c 05 00 33   0000XNOCASE....3
         2730  +|   3328: 0f 17 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30   ..MAX MEMORY=500
         2731  +|   3344: 30 30 30 30 30 58 52 54 52 49 4d 18 1b 05 00 25   00000XRTRIM....%
         2732  +|   3360: 0f 19 45 4e 41 42 4c 45 20 52 54 52 45 45 58 42   ..ENABLE RTREEXB
         2733  +|   3376: 49 4e 41 52 59 18 1a 05 00 25 0f 19 45 4e 41 42   INARY....%..ENAB
         2734  +|   3392: 4c 45 20 52 54 52 45 45 58 4e 4f 43 41 53 45 17   LE RTREEXNOCASE.
         2735  +|   3408: 19 05 00 25 0f 17 45 4e 41 42 4c 45 20 52 54 52   ...%..ENABLE RTR
         2736  +|   3424: 45 45 58 52 54 52 49 4d 1a 18 05 00 29 0f 19 45   EEXRTRIM....)..E
         2737  +|   3440: 4e 41 42 4c 45 20 4d 45 4d 53 59 53 35 58 42 49   NABLE MEMSYS5XBI
         2738  +|   3456: 4e 41 52 59 1a 17 05 00 29 0f 19 45 4e 41 42 4c   NARY....)..ENABL
         2739  +|   3472: 42 60 2d 45 4d 53 59 53 35 58 4e 4f 43 41 53 45   B`-EMSYS5XNOCASE
         2740  +|   3488: 19 16 05 00 29 0f 17 45 4e 41 42 4c 45 20 4d 45   ....)..ENABLE ME
         2741  +|   3504: 4d 53 59 53 35 58 52 54 52 49 4d 18 15 05 00 25   MSYS5XRTRIM....%
         2742  +|   3520: 0f 19 45 4e 41 42 4c 45 20 4a 53 4f 4e 31 58 42   ..ENABLE JSON1XB
         2743  +|   3536: 49 4e 41 52 59 18 14 05 00 25 0f 19 45 4e 41 42   INARY....%..ENAB
         2744  +|   3552: 4c 45 20 4a 53 4f 4e 31 58 4e 4f 43 41 53 45 17   LE JSON1XNOCASE.
         2745  +|   3568: 13 05 00 25 0f 17 45 4e 41 42 4c 45 20 4a 53 4f   ...%..ENABLE JSO
         2746  +|   3584: 4e 31 58 52 54 52 49 4d 1a 12 05 00 29 0f 19 45   N1XRTRIM....)..E
         2747  +|   3600: 4e 41 42 4c 45 20 47 45 4f 50 4f 4c 59 58 42 49   NABLE GEOPOLYXBI
         2748  +|   3616: 4e 41 52 59 1a 11 05 00 29 0f 19 45 4e 41 42 4c   NARY....)..ENABL
         2749  +|   3632: 45 20 47 45 4f 50 4f 4c 59 58 4e 4f 43 41 53 45   E GEOPOLYXNOCASE
         2750  +|   3648: 19 10 05 00 29 0f 17 45 4e 41 42 4c 45 20 47 45   ....)..ENABLE GE
         2751  +|   3664: 4f 50 4f 4c 59 58 52 54 52 49 4d 0f 86 00 94 23   OPOLYXRTRIM....#
         2752  +|   3680: 0f 19 45 4e 41 42 4c 45 20 46 54 53 35 58 42 49   ..ENABLE FTS5XBI
         2753  +|   3696: 4e 41 52 59 00 00 00 7b 23 0f 19 45 4e 41 42 4c   NARY....#..ENABL
         2754  +|   3712: 45 20 46 54 53 35 58 4e 4f 43 41 53 45 00 00 00   E FTS5XNOCASE...
         2755  +|   3728: 62 23 0f 17 45 4e 41 42 4c 45 20 46 54 53 35 58   b#..ENABLE FTS5X
         2756  +|   3744: 52 54 52 49 4d 00 00 00 4a 23 0f 19 45 4e 41 42   RTRIM...J#..ENAB
         2757  +|   3760: 4c 45 20 46 54 53 34 58 42 49 4e 41 52 59 00 00   LE FTS4XBINARY..
         2758  +|   3776: 00 31 23 0f 19 45 4e 41 42 4c 45 20 46 54 53 34   .1#..ENABLE FTS4
         2759  +|   3792: 58 4e 4f 43 41 53 45 00 00 00 18 23 0f 17 45 4e   XNOCASE....#..EN
         2760  +|   3808: 41 42 4c 45 20 46 54 53 34 58 52 54 52 49 4d 1e   ABLE FTS4XRTRIM.
         2761  +|   3824: 09 05 00 31 0f 19 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         2762  +|   3840: 54 41 54 20 56 54 41 42 58 42 49 4e 41 52 59 1e   TAT VTABXBINARY.
         2763  +|   3856: 08 05 00 31 0f 19 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         2764  +|   3872: 54 41 54 20 56 54 24 15 48 4e 4f 43 41 53 45 1d   TAT VT$.HNOCASE.
         2765  +|   3888: 07 05 00 31 0f 17 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         2766  +|   3904: 54 41 54 20 56 54 41 42 58 52 54 52 49 4d 11 06   TAT VTABXRTRIM..
         2767  +|   3920: 05 00 17 0f 19 44 45 42 55 47 58 42 49 4e 41 52   .....DEBUGXBINAR
         2768  +|   3936: 59 11 05 05 00 17 0f 19 44 45 42 55 47 58 4e 4f   Y.......DEBUGXNO
         2769  +|   3952: 43 41 53 45 10 04 05 00 17 0f 17 44 45 42 55 47   CASE.......DEBUG
         2770  +|   3968: 58 52 54 52 49 4d 00 00 00 29 43 0f 19 43 4f 4d   XRTRIM...)C..COM
         2771  +|   3984: 50 49 4c 45 52 3d 67 63 63 2d 35 2e 34 2e 30 20   PILER=gcc-5.4.0 
         2772  +|   4000: 32 30 31 36 30 36 30 39 58 42 49 4e 41 52 59 27   20160609XBINARY'
         2773  +|   4016: 02 05 00 43 0f 19 43 4f 4d 50 49 4c 45 52 3d 67   ...C..COMPILER=g
         2774  +|   4032: 63 63 2d 35 2e 34 2e 30 20 32 30 31 36 30 36 30   cc-5.4.0 2016060
         2775  +|   4048: 39 58 4e 4f 43 41 53 45 26 01 05 00 43 0f 17 43   9XNOCASE&...C..C
         2776  +|   4064: 4f 4d 50 49 4c 45 52 3d 67 63 63 2d 35 2e 34 2e   OMPILER=gcc-5.4.
         2777  +|   4080: 30 20 32 30 31 36 30 36 30 39 58 52 54 52 49 4d   0 20160609XRTRIM
         2778  +| page 6 offset 20480
         2779  +|      0: 0d 0f 88 00 1e 0e e0 00 0f f8 0f f0 0f b0 0f e0   ................
         2780  +|     16: 0f d8 0f d0 0f c8 0f c0 0f b8 0f 80 0f 78 0f 70   .............x.p
         2781  +|     32: 0f 68 0f 60 0f 58 0f 50 0f 48 0f 40 0f 38 0f 30   .h.`.X.P.H.@.8.0
         2782  +|     48: 0f 28 0f 20 0f 18 0f 10 0f 08 0f 00 0e f8 0e f0   .(. ............
         2783  +|     64: 0e e8 0e e0 0e e0 0e e0 0e e0 0e e0 0e e0 0e e0   ................
         2784  +|   3808: 06 24 03 00 12 02 01 01 06 23 03 00 12 02 01 01   .$.......#......
         2785  +|   3824: 06 22 03 00 12 02 01 01 06 21 03 00 12 03 01 01   .........!......
         2786  +|   3840: 06 20 03 00 12 03 01 01 06 1f 03 00 12 03 01 01   . ..............
         2787  +|   3856: 06 1e 03 00 12 03 01 01 06 1d 03 00 12 03 01 01   ................
         2788  +|   3872: 06 1c 03 00 12 03 01 01 06 1b 03 00 12 02 01 01   ................
         2789  +|   3888: 06 1a 03 00 12 02 01 01 06 19 03 00 12 02 01 01   ................
         2790  +|   3904: 06 18 03 00 12 02 01 01 06 17 03 00 12 02 01 01   ................
         2791  +|   3920: 06 16 03 00 12 02 01 01 06 15 03 00 12 02 01 01   ................
         2792  +|   3936: 06 14 03 00 12 02 01 01 06 13 03 00 12 02 01 01   ................
         2793  +|   3952: 06 12 03 00 12 02 01 01 06 11 03 00 12 02 01 01   ................
         2794  +|   3968: 06 10 03 00 12 02 01 01 0f e8 00 28 12 02 01 01   ...........(....
         2795  +|   3984: 00 00 00 28 12 02 01 01 00 00 00 20 12 02 01 01   ...(....... ....
         2796  +|   4000: 00 00 00 18 12 02 01 01 00 00 00 10 12 02 01 01   ................
         2797  +|   4016: 06 03 03 00 12 06 02 01 06 09 03 00 12 03 01 01   ................
         2798  +|   4032: 06 08 03 00 12 03 01 01 06 07 03 00 12 03 01 01   ................
         2799  +|   4048: 06 06 03 00 12 01 01 01 06 05 03 00 12 01 01 01   ................
         2800  +|   4064: 06 04 03 00 12 01 01 01 00 00 00 08 12 06 01 01   ................
         2801  +|   4080: 06 02 03 00 12 06 01 01 06 01 03 00 12 06 01 01   ................
         2802  +| page 7 offset 24576
         2803  +|      0: 0a 00 00 00 01 0f f4 00 0f f4 00 00 00 00 00 00   ................
         2804  +|   4080: 00 00 00 00 0b 03 1b 01 76 65 72 73 69 6f 6e 04   ........version.
         2805  +| page 8 offset 28672
         2806  +|      0: 0d 00 00 00 03 0f d6 00 0f f4 0f e9 0f d6 00 00   ................
         2807  +|   4048: 00 00 00 00 00 00 11 03 02 2b 69 6e 74 65 67 72   .........+integr
         2808  +|   4064: 69 74 79 2d 63 68 65 63 6b 09 02 02 1b 72 65 62   ity-check....reb
         2809  +|   4080: 75 69 6c 64 0a 01 02 1d 6f 70 74 69 6d 69 7a 65   uild....optimize
         2810  +| end c30b.db
         2811  +}]} {}
         2812  +
         2813  +do_catchsql_test 26.1 {
         2814  +  BEGIN;
         2815  +    INSERT INTO t1(t1) VALUES('rebuild');
         2816  +    INSERT INTO t1(t1) VALUES('integrity-check');
         2817  +  COMMIT;
         2818  +} {0 {}}
  2526   2819   
  2527   2820   sqlite3_fts5_may_be_corrupt 0
  2528   2821   finish_test
  2529   2822