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

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

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/fts3defer2.test ('k') | third_party/sqlite/src/test/fts3expr5.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/fts3expr3.test
diff --git a/third_party/sqlite/src/test/fts3expr3.test b/third_party/sqlite/src/test/fts3expr3.test
index a8d7319266afed1269af26dbdaa3b7aadeda27d1..83c153218c85495dc9a1e611e97552c0514aaf7c 100644
--- a/third_party/sqlite/src/test/fts3expr3.test
+++ b/third_party/sqlite/src/test/fts3expr3.test
@@ -122,6 +122,8 @@ proc balanced_andor_tree {nEntry} {
return $tree
}
+if 1 {
+
# Test that queries like "1 AND 2 AND 3 AND 4..." are transformed to
# balanced trees by FTS.
#
@@ -202,5 +204,35 @@ do_faultsim_test fts3expr3-fault-1 -faults oom-* -body {
faultsim_test_result [list 0 $::result]
}
+}
+
+#-------------------------------------------------------------------
+
+foreach {tn expr res} {
+ 1 {1 OR 2 OR 3 OR 4} {OR {OR {P 1} {P 2}} {OR {P 3} {P 4}}}
+ 2 {1 OR (2 AND 3 AND 4 AND 5)}
+ {OR {P 1} {AND {AND {P 2} {P 3}} {AND {P 4} {P 5}}}}
+ 3 {(2 AND 3 AND 4 AND 5) OR 1}
+ {OR {AND {AND {P 2} {P 3}} {AND {P 4} {P 5}}} {P 1}}
+
+ 4 {1 AND (2 OR 3 OR 4 OR 5)}
+ {AND {P 1} {OR {OR {P 2} {P 3}} {OR {P 4} {P 5}}}}
+ 5 {(2 OR 3 OR 4 OR 5) AND 1}
+ {AND {OR {OR {P 2} {P 3}} {OR {P 4} {P 5}}} {P 1}}
+
+ 6 {(2 OR 3 OR 4 OR 5) NOT 1}
+ {NOT {OR {OR {P 2} {P 3}} {OR {P 4} {P 5}}} {P 1}}
+
+ 7 {1 NOT (2 OR 3 OR 4 OR 5)}
+ {NOT {P 1} {OR {OR {P 2} {P 3}} {OR {P 4} {P 5}}}}
+
+ 8 {(1 OR 2 OR 3 OR 4) NOT (5 AND 6 AND 7 AND 8)}
+ {NOT {OR {OR {P 1} {P 2}} {OR {P 3} {P 4}}} {AND {AND {P 5} {P 6}} {AND {P 7} {P 8}}}}
+} {
+ do_test 5.1.$tn {
+ test_fts3expr2 $expr
+ } $res
+}
+
set sqlite_fts3_enable_parentheses 0
finish_test
« no previous file with comments | « third_party/sqlite/src/test/fts3defer2.test ('k') | third_party/sqlite/src/test/fts3expr5.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698