/ Check-in [ecab2083]
Login

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

Overview
Comment:Add test cases to fts4merge.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fts4-incr-merge
Files: files | file ages | folders
SHA1: ecab2083334dcdde24a3c56864114979b7a6f25a
User & Date: dan 2012-03-22 17:48:00
Context
2012-03-23
11:07
Update a couple of existing test cases. check-in: dcb8fa0f user: dan tags: fts4-incr-merge
2012-03-22
17:48
Add test cases to fts4merge.test. check-in: ecab2083 user: dan tags: fts4-incr-merge
16:48
Following an incr-merge operation that does not completely consume its input segments, store context in the rowid==1 row of the %_stat table that allows the next incr-merge to pick up where the previous left off. check-in: ab0a4f44 user: dan tags: fts4-incr-merge
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/fts4merge.test.

   157    157   } {X'0006'}
   158    158   
   159    159   do_execsql_test 4.4.2 {
   160    160     DELETE FROM t4_stat WHERE rowid=1;
   161    161     INSERT INTO t4(t4) VALUES('merge=1,12');
   162    162     SELECT level, group_concat(idx, ' ') FROM t4_segdir GROUP BY level;
   163    163   } "0 {0 1 2 3 4 5}                     1 0"
          164  +
          165  +#-------------------------------------------------------------------------
          166  +# Test cases 5.*
          167  +#
          168  +# Test that if a crisis-merge occurs that disrupts an ongoing incremental
          169  +# merge, the next call to "merge=A,B" identifies this and starts a new
          170  +# incremental merge. There are two scenarios:
          171  +#
          172  +#   * There are less segments on the input level that the disrupted
          173  +#     incremental merge operated on, or
          174  +#   
          175  +#   * Sufficient segments exist on the input level but the segments 
          176  +#     contain keys smaller than the largest key in the potential output 
          177  +#     segment.
          178  +# 
          179  +do_test 5.1 {
          180  +  reset_db
          181  +  fts3_build_db_1 1000
          182  +} {}
          183  +
          184  +do_execsql_test 5.2 {
          185  +  SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level;
          186  +} {
          187  +  0 {0 1 2 3 4 5 6 7} 
          188  +  1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} 
          189  +  2 {0 1 2}
          190  +}
          191  +
          192  +do_execsql_test 5.3 {
          193  +  INSERT INTO t1(t1) VALUES('merge=1,4');
          194  +  SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level;
          195  +} {
          196  +  0 {0 1 2 3 4 5 6 7} 
          197  +  1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} 
          198  +  2 {0 1 2 3}
          199  +}
          200  +
          201  +do_execsql_test 5.4 {SELECT quote(value) from t1_stat WHERE rowid=1} {X'0104'}
          202  +do_test 5.5 {
          203  +  foreach docid [execsql {SELECT docid FROM t1}] {
          204  +    execsql {INSERT INTO t1 SELECT * FROM t1 WHERE docid=$docid}
          205  +  }
          206  +} {}
          207  +
          208  +do_execsql_test 5.6 {SELECT quote(value) from t1_stat WHERE rowid=1} {X'0104'}
          209  +
          210  +do_execsql_test 5.7 {
          211  +  SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level;
          212  +  SELECT quote(value) from t1_stat WHERE rowid=1;
          213  +} {
          214  +  0 {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15} 
          215  +  1 {0 1 2 3 4 5 6 7 8 9 10 11} 
          216  +  2 {0 1 2 3 4 5 6 7}
          217  +  X'0104'
          218  +}
          219  +
          220  +do_execsql_test 5.8 {
          221  +  INSERT INTO t1(t1) VALUES('merge=1,4');
          222  +  SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level;
          223  +  SELECT quote(value) from t1_stat WHERE rowid=1;
          224  +} {
          225  +  0 {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15} 
          226  +  1 {0 1 2 3 4 5 6 7 8 9 10 11} 
          227  +  2 {0 1 2 3 4 5 6 7}
          228  +  3 {0}
          229  +  X'0204'
          230  +}
          231  +
          232  +do_test 5.9 {
          233  +  set L [expr 16*16*8 + 16*4 + 1]
          234  +  foreach docid [execsql {
          235  +      SELECT docid FROM t1 UNION ALL SELECT docid FROM t1 LIMIT $L
          236  +  }] {
          237  +    execsql {INSERT INTO t1 SELECT * FROM t1 WHERE docid=$docid}
          238  +  }
          239  +} {}
          240  +
          241  +do_execsql_test 5.10 {
          242  +  SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level;
          243  +  SELECT quote(value) from t1_stat WHERE rowid=1;
          244  +} {
          245  +  0 0   1 0   2 0   3 {0 1}
          246  +  X'0204'
          247  +}
          248  +
          249  +do_execsql_test 5.11 {
          250  +  INSERT INTO t1(t1) VALUES('merge=10,4');
          251  +  SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level;
          252  +  SELECT quote(value) from t1_stat WHERE rowid=1;
          253  +} {
          254  +  0 0   1 0   2 0   3 {0 1}
          255  +  X'0000'
          256  +}
   164    257   
   165    258   
   166    259   finish_test