Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: third_party/sqlite/src/test/fts3an.test

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/fts3al.test ('k') | third_party/sqlite/src/test/fts3ao.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/sqlite/src/test/fts3al.test ('k') | third_party/sqlite/src/test/fts3ao.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698