OLD | NEW |
1 # 2012 March 06 | 1 # 2012 March 06 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #************************************************************************* | 10 #************************************************************************* |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 # Run some incr-merge operations on the db. | 55 # Run some incr-merge operations on the db. |
56 for {set i 0} {$i<10} {incr i} { | 56 for {set i 0} {$i<10} {incr i} { |
57 do_test 1.6.$i.1 { sql1 { INSERT INTO t2(t2) VALUES('merge=2,2') } } {} | 57 do_test 1.6.$i.1 { sql1 { INSERT INTO t2(t2) VALUES('merge=2,2') } } {} |
58 do_test 1.6.$i.2 { | 58 do_test 1.6.$i.2 { |
59 sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" | 59 sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" |
60 } {1485} | 60 } {1485} |
61 } | 61 } |
62 | 62 |
63 do_test 1.7 { sql2 { | 63 do_test 1.7 { sql2 { |
64 SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 | 64 SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 |
65 } } [list 0 1 2 18 3 5] | 65 } } {2 15 3 5} |
66 | 66 |
67 # Using the old connection, insert many rows. | 67 # Using the old connection, insert many rows. |
68 do_test 1.8 { | 68 do_test 1.8 { |
69 for {set i 0} {$i < 1500} {incr i} { | 69 for {set i 0} {$i < 1500} {incr i} { |
70 sql2 "INSERT INTO t2 SELECT content FROM t2 WHERE docid = $i" | 70 sql2 "INSERT INTO t2 SELECT content FROM t2 WHERE docid = $i" |
71 } | 71 } |
72 } {} | 72 } {} |
73 | 73 |
74 do_test 1.9 { sql2 { | 74 do_test 1.9 { sql2 { |
75 SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 | 75 SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 |
76 } } [list 0 13 1 13 2 5 3 6] | 76 } } [list 0 12 1 13 2 4 3 6] |
77 | 77 |
78 # Run a big incr-merge operation on the db. | 78 # Run a big incr-merge operation on the db. |
79 do_test 1.10 { sql1 { INSERT INTO t2(t2) VALUES('merge=2000,2') } } {} | 79 do_test 1.10 { sql1 { INSERT INTO t2(t2) VALUES('merge=2000,2') } } {} |
80 do_test 1.11 { | 80 do_test 1.11 { |
81 sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" | 81 sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" |
82 } {1485 21485} | 82 } {1485 21485} |
83 | 83 |
84 do_test 1.12 { | 84 do_test 1.12 { |
85 for {set i 0} {$i < 1500} {incr i} { | 85 for {set i 0} {$i < 1500} {incr i} { |
86 sql2 "INSERT INTO t2 SELECT content FROM t2 WHERE docid = $i" | 86 sql2 "INSERT INTO t2 SELECT content FROM t2 WHERE docid = $i" |
87 } | 87 } |
88 } {} | 88 } {} |
89 do_test 1.13 { | 89 do_test 1.13 { |
90 sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" | 90 sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" |
91 } {1485 21485 22985} | 91 } {1485 21485 22985} |
92 | 92 |
93 do_test 1.14 { | 93 do_test 1.14 { |
94 sql2 "INSERT INTO t2(t2) VALUES('optimize')" | 94 sql2 "INSERT INTO t2(t2) VALUES('optimize')" |
95 sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" | 95 sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" |
96 } {1485 21485 22985} | 96 } {1485 21485 22985} |
97 | 97 |
98 do_test 1.15 { sql2 { | 98 do_test 1.15 { sql2 { |
99 SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 | 99 SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 |
100 } } {6 1} | 100 } } {4 1} |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 | 104 |
105 finish_test | 105 finish_test |
OLD | NEW |