Index: third_party/sqlite/src/test/fts3an.test |
diff --git a/third_party/sqlite/src/test/fts3an.test b/third_party/sqlite/src/test/fts3an.test |
index f19d573206efb585eebd5262621c259f4400f86a..521102776718fe2215e0028a68d3d99e83524c98 100644 |
--- a/third_party/sqlite/src/test/fts3an.test |
+++ b/third_party/sqlite/src/test/fts3an.test |
@@ -169,7 +169,7 @@ db eval { |
INSERT INTO t3(rowid, c) VALUES(1, $text); |
INSERT INTO t3(rowid, c) VALUES(2, 'Another lovely row'); |
} |
-for {set i 0} {$i<100} {incr i} { |
+for {set i 0} {$i<68} {incr i} { |
db eval {INSERT INTO t3(rowid, c) VALUES(3+$i, $bigtext)} |
lappend ret 192 |
} |
@@ -185,12 +185,34 @@ do_test fts3an-3.1 { |
set t |
} $ret |
-# TODO(shess) It would be useful to test a couple edge cases, but I |
-# don't know if we have the precision to manage it from here at this |
-# time. Prefix hits can cross leaves, which the code above _should_ |
-# hit by virtue of size. There are two variations on this. If the |
-# tree is 2 levels high, the code will find the leaf-node extent |
-# directly, but if it is higher, the code will have to follow two |
-# separate interior branches down the tree. Both should be tested. |
+# Test a boundary condition: More than 2^16 terms that match a searched for |
+# prefix in a single segment. |
+# |
+puts "This next test can take a little while (~ 30 seconds)..." |
+do_test fts3an-4.1 { |
+ execsql { CREATE VIRTUAL TABLE ft USING fts3(x) } |
+ execsql BEGIN |
+ execsql { INSERT INTO ft VALUES(NULL) } |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 2 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 4 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 8 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 16 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 32 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 64 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 128 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 256 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 512 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 1024 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 2048 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 4096 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 8192 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 16384 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 32768 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 65536 |
+ execsql { INSERT INTO ft SELECT * FROM ft } ;# 131072 |
+ execsql COMMIT |
+ execsql { UPDATE ft SET x = 'abc' || rowid } |
+ execsql { SELECT count(*) FROM ft WHERE x MATCH 'abc*' } |
+} {131072} |
finish_test |