/ Check-in [9fde5b96]
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:Fix a broken test case in fts4growth2.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9fde5b960af39b187474e5b2909ff0e56d5e0bf9
User & Date: dan 2014-05-17 15:10:37
Context
2014-05-17
16:56
Internally, use a 64-bit integers for segment level numbers. check-in: 8180e320 user: dan tags: trunk
15:10
Fix a broken test case in fts4growth2.test. check-in: 9fde5b96 user: dan tags: trunk
2014-05-16
23:15
Work around compilation issue with MSVC. check-in: 9623a29c user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/fts4growth2.test.

23
24
25
26
27
28
29




30
31
32
33
34


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  return
}

source $testdir/genesis.tcl

do_execsql_test 1.0 { CREATE TABLE t1(docid, words); }
fts_kjv_genesis 





proc tt {val} {
  execsql {
    DELETE FROM x1 
      WHERE docid IN (SELECT docid FROM t1 WHERE (rowid-1)%4==$val+0);


    INSERT INTO x1(docid, content) 
      SELECT docid, words FROM t1 WHERE (rowid%4)==$val+0;
  }
  #puts [db eval {SELECT level, idx, end_block FROM x1_segdir}]
}

do_execsql_test 1.1 {
  CREATE VIRTUAL TABLE x1 USING fts4;
  INSERT INTO x1(x1) VALUES('automerge=2');
}

do_test 1.2 {
  for {set i 0} {$i < 40} {incr i} {
    tt 0 ; tt 1 ; tt 2 ; tt 3
  }
  execsql { 
    SELECT max(level) FROM x1_segdir; 
    SELECT count(*) FROM x1_segdir WHERE level=3;
  }
} {3 1}

do_test 1.3 {
  for {set i 0} {$i < 40} {incr i} {
    tt 0 ; tt 1 ; tt 2 ; tt 3
  }
  execsql { 
    SELECT max(level) FROM x1_segdir; 







>
>
>
>





>
>



<













|

|







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  return
}

source $testdir/genesis.tcl

do_execsql_test 1.0 { CREATE TABLE t1(docid, words); }
fts_kjv_genesis 

proc structure {} {
  puts [ db eval {SELECT level, count(*) FROM x1_segdir GROUP BY level} ]
}

proc tt {val} {
  execsql {
    DELETE FROM x1 
      WHERE docid IN (SELECT docid FROM t1 WHERE (rowid-1)%4==$val+0);
  }
  execsql {
    INSERT INTO x1(docid, content) 
      SELECT docid, words FROM t1 WHERE (rowid%4)==$val+0;
  }

}

do_execsql_test 1.1 {
  CREATE VIRTUAL TABLE x1 USING fts4;
  INSERT INTO x1(x1) VALUES('automerge=2');
}

do_test 1.2 {
  for {set i 0} {$i < 40} {incr i} {
    tt 0 ; tt 1 ; tt 2 ; tt 3
  }
  execsql { 
    SELECT max(level) FROM x1_segdir; 
    SELECT count(*) FROM x1_segdir WHERE level=2;
  }
} {2 1}

do_test 1.3 {
  for {set i 0} {$i < 40} {incr i} {
    tt 0 ; tt 1 ; tt 2 ; tt 3
  }
  execsql { 
    SELECT max(level) FROM x1_segdir;