]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the threadtest3 test program so that it works with VFSes that omit the
authordrh <drh@noemail.net>
Mon, 30 Nov 2015 19:15:25 +0000 (19:15 +0000)
committerdrh <drh@noemail.net>
Mon, 30 Nov 2015 19:15:25 +0000 (19:15 +0000)
xCurrentTime() method and supply only xCurrentTimeInt64().

FossilOrigin-Name: 3b155855f3d5918f1df7dbd19783215b3da0ca3e

manifest
manifest.uuid
test/threadtest3.c

index f39be554daa9da42636d2b1d9b1740d0e2db5c5d..5201b9519b5bac932069dbb4339d42cdf4c3ec1b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sthe\s"colUsed"\sfield\sto\sthe\ssqlite3_index_info\sstructure\spassed\sto\svirtual\stable\sxBestIndex\smethods.\sTo\sindicate\sthe\ssubset\sof\sthe\svirtual\stable\scolumns\sthat\smay\sbe\srequired\sby\sthe\scurrent\sscan.
-D 2015-11-30T12:01:37.135
+C Fix\sthe\sthreadtest3\stest\sprogram\sso\sthat\sit\sworks\swith\sVFSes\sthat\somit\sthe\nxCurrentTime()\smethod\sand\ssupply\sonly\sxCurrentTimeInt64().
+D 2015-11-30T19:15:25.436
 F Makefile.in d828db6afa6c1fa060d01e33e4674408df1942a1
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc e928e68168df69b353300ac87c10105206653a03
@@ -1072,7 +1072,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46
 F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd
 F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
 F test/threadtest2.c a70a8e94bef23339d34226eb9521015ef99f4df8
-F test/threadtest3.c 9ab4b168681c3a6f70f6c833ba08e0d48dd4af9b
+F test/threadtest3.c 0707c28e0954acbef654f91675e14f3573cf9a10
 F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925
 F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
 F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
@@ -1406,7 +1406,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 583813525888c7e106f3e8cb46c1a507006daee6 116b206494eb8ba963c7c5acfbf9e7b6db11c79c
-R 85fc84cc9bc3e1532ec1e735dc703c3b
-U dan
-Z eb992ed0e070d727cd79b36741d8ea82
+P 47f10b7e5d8c1d965df891990090623444933cc9
+R 585e8fe5d4364350ebf759c316009b08
+U drh
+Z a830d371ea8bc3ea09f7879f209590a2
index 29b821c451b612059d4e7181764c8f676946fc64..a098f5595354f8ae2f06c3719541197adc5153f6 100644 (file)
@@ -1 +1 @@
-47f10b7e5d8c1d965df891990090623444933cc9
\ No newline at end of file
+3b155855f3d5918f1df7dbd19783215b3da0ca3e
\ No newline at end of file
index 25caeb89f9fb413829528cf5962f3df008c95f54..a3fcae28cc08ae1d6f24894fd2201740e446fd7a 100644 (file)
@@ -868,22 +868,28 @@ static void filecopy_x(
 ** Used by setstoptime() and timetostop().
 */
 static double timelimit = 0.0;
-static sqlite3_vfs *pTimelimitVfs = 0;
+
+static double currentTime(void){
+  double t;
+  static sqlite3_vfs *pTimelimitVfs = 0;
+  if( pTimelimitVfs==0 ) pTimelimitVfs = sqlite3_vfs_find(0);
+  if( pTimelimitVfs->iVersion>=1 && pTimelimitVfs->xCurrentTimeInt64!=0 ){
+    sqlite3_int64 tm;
+    pTimelimitVfs->xCurrentTimeInt64(pTimelimitVfs, &tm);
+    t = tm/86400000.0;
+  }else{
+    pTimelimitVfs->xCurrentTime(pTimelimitVfs, &t);
+  }
+  return t;
+}
 
 static void setstoptime_x(
   Error *pErr,                    /* IN/OUT: Error code */
   int nMs                         /* Milliseconds until "stop time" */
 ){
   if( pErr->rc==SQLITE_OK ){
-    double t;
-    int rc;
-    pTimelimitVfs = sqlite3_vfs_find(0);
-    rc = pTimelimitVfs->xCurrentTime(pTimelimitVfs, &t);
-    if( rc!=SQLITE_OK ){
-      pErr->rc = rc;
-    }else{
-      timelimit = t + ((double)nMs)/(1000.0*60.0*60.0*24.0);
-    }
+    double t = currentTime();
+    timelimit = t + ((double)nMs)/(1000.0*60.0*60.0*24.0);
   }
 }
 
@@ -892,14 +898,8 @@ static int timetostop_x(
 ){
   int ret = 1;
   if( pErr->rc==SQLITE_OK ){
-    double t;
-    int rc;
-    rc = pTimelimitVfs->xCurrentTime(pTimelimitVfs, &t);
-    if( rc!=SQLITE_OK ){
-      pErr->rc = rc;
-    }else{
-      ret = (t >= timelimit);
-    }
+    double t = currentTime();
+    ret = (t >= timelimit);
   }
   return ret;
 }