]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix some matchinfo related test problems in fts3rnd.test.
authordan <dan@noemail.net>
Thu, 14 Jan 2010 11:17:05 +0000 (11:17 +0000)
committerdan <dan@noemail.net>
Thu, 14 Jan 2010 11:17:05 +0000 (11:17 +0000)
FossilOrigin-Name: da7abe05887d1ad52552d8ce3a153a0a76f96c5a

manifest
manifest.uuid
test/fts3rnd.test

index 5d5a142462a6356a5ea59957d1e3eb263632483e..b19620498600cb7144c87a25cd8245391db6633e 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,5 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-C Comment\scleanup\sin\ssqliteInt.h.
-D 2010-01-14T00:39:26
+C Fix\ssome\smatchinfo\srelated\stest\sproblems\sin\sfts3rnd.test.
+D 2010-01-14T11:17:05
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -407,7 +404,7 @@ F test/fts3expr2.test 18da930352e5693eaa163a3eacf96233b7290d1a
 F test/fts3malloc.test d02ee86b21edd2b43044e0d6dfdcd26cb6efddcb
 F test/fts3near.test 2e318ee434d32babd27c167142e2b94ddbab4844
 F test/fts3query.test 154fe4b015fd61af523ee083570a134f508f5be7
-F test/fts3rnd.test 153b4214bad6084a348814f3dd651a92e2f31d9b
+F test/fts3rnd.test 2f5761db9dd92f6fe09d08976ac658ef521846ed
 F test/fts3snippet.test 16a05b313bf85da4d0b5cb683549fc2279430fbe
 F test/func.test af106ed834001738246d276659406823e35cde7b
 F test/func2.test 772d66227e4e6684b86053302e2d74a2500e1e0f
@@ -788,14 +785,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 56f232d562bc239103a5afd2e64c4b926a20de08
-R 3b331cd0e95e4d69ff5c9f9bfafab8bd
-U drh
-Z b5abd666e8f857d795728a3a90d182a6
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-iD8DBQFLTmfWoxKgR168RlERAikxAJ9Wj+u6555vXm+xBTOR0LRgevvzlQCcDtL6
-h1OBnqJI6Rk9bG44HfgzbwU=
-=19E+
------END PGP SIGNATURE-----
+P 67c3aea563e019083f0ed87b57982a0379637d4f
+R 8e69825ad6823779e3340d8c7cfb5e0a
+U dan
+Z b7d555c32c5b8aefdf64aab0d007e815
index e643c78d32228e811d379a8bf22e2c83bead23fd..e2d2161f5891f95c4322bdf459500bf3cb4c4171 100644 (file)
@@ -1 +1 @@
-67c3aea563e019083f0ed87b57982a0379637d4f
\ No newline at end of file
+da7abe05887d1ad52552d8ce3a153a0a76f96c5a
\ No newline at end of file
index c319d35d6965ce79fb5b271983850640c429c855..2dcde0f009790590c323f5c3f44880c3994c999e 100644 (file)
@@ -159,25 +159,41 @@ proc simple_phrase {zPrefix} {
   set ret
 }
 
+# This [proc] is used to test the FTS3 matchinfo() function.
+# 
 proc simple_token_matchinfo {zToken} {
-  set total(0) 0
-  set total(1) 0
-  set total(2) 0
 
-  foreach key [lsort -integer [array names ::t1]] {
+  set nDoc(0) 0
+  set nDoc(1) 0
+  set nDoc(2) 0
+  set nHit(0) 0
+  set nHit(1) 0
+  set nHit(2) 0
+
+
+  foreach key [array names ::t1] {
     set value $::t1($key)
-    set cnt [list]
+    set a($key) [list]
     foreach i {0 1 2} col $value {
-      set n [llength [lsearch -all $col $zToken]]
-      lappend cnt $n
-      incr total($i) $n
+      set hit [llength [lsearch -all $col $zToken]]
+      lappend a($key) $hit
+      incr nHit($i) $hit
+      if {$hit>0} { incr nDoc($i) }
     }
-    if {[lindex [lsort $cnt] end]} {
-      lappend ret $key [concat 1 3 XXX $cnt]
+  }
+
+  set ret [list]
+  foreach docid [lsort -integer [array names a]] {
+    if { [lindex [lsort -integer $a($docid)] end] } {
+      set matchinfo [list 1 3]
+      foreach i {0 1 2} hit $a($docid) {
+        lappend matchinfo $hit $nHit($i) $nDoc($i)
+      }
+      lappend ret $docid $matchinfo
     }
   }
-  
-  string map [list XXX "$total(0) $total(1) $total(2)"] $ret
+
+  set ret
 } 
 
 proc simple_near {termlist nNear} {