diff --git a/manifest b/manifest index d7e2b18402..456fbb06b0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improvements\sto\sthe\stimediff()\sfunction.\s\sTest\scases\sadded.\sNot\sall\stest\ncases\sare\spassing. -D 2023-05-30T02:16:33.896 +C Problems\sfixed.\s\sAll\stests\sare\spassing\snow. +D 2023-05-30T02:50:32.127 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -583,7 +583,7 @@ F src/build.c 5512d5a335334b48d116f1ecd051edef96a60add18ae48e0ea302a395f00f3d9 F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d490 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/ctime.c 20507cc0b0a6c19cd882fcd0eaeda32ae6a4229fb4b024cfdf3183043d9b703d -F src/date.c 71c0484764e7d2c4a5f7a98c4e6d3403998eae554a81b3c02a90a1c836049902 +F src/date.c bd35fd6aadd63dd0019ccd54314e74e058d024704fd02ac22e0041b6012fa610 F src/dbpage.c f3eea5f7ec47e09ee7da40f42b25092ecbe961fc59566b8e5f705f34335b2387 F src/dbstat.c ec92074baa61d883de58c945162d9e666c13cd7cf3a23bc38b4d1c4d0b2c2bef F src/delete.c 05e27e3a55dcfeadf2f7ca95a5c5e0928f182c04640ec1954ffa42f3d5c19341 @@ -1605,7 +1605,7 @@ F test/threadtest3.c 655bff6c0895ec03f014126aa65e808fac9aae8c5a7a7da58a510cbe8b4 F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925 F test/threadtest5.c 9b4d782c58d8915d7e955ff8051f3d03628bda0d33b82971ea8c0f2f2808c421 F test/time-wordcount.sh 8e0b0f8109367827ad5d58f5cc849705731e4b90 -F test/timediff1.test 701eea6ce725d71305d64292b44d9a0154b7c99ce09c916f9386de3e71689918 +F test/timediff1.test ff10ea5829bbe7d11c3c9bed75f8cba1cf42b3c23bd68c4f9d6ef8868546eb85 F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c F test/tkt-18458b1a.test 6a62cb1ee50fa3c620da59e3a6f531eb38fceaf7e2166203816b724524e6f1d6 F test/tkt-26ff0c2d1e.test c15bec890c4d226c0da2f35ff30f9e84c169cfef90e73a8cb5cec11d723dfa96 @@ -2072,8 +2072,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 3832b8a9ef84d9b53b48dfce9c1e724897cd7b3e05711e01675419655f894eac -R 8ffc400398f351d057bce50fed0005bf +P 2cf6518140d61e2123dc20f39d7e97e7bce17e7641405df7fd63e1cdda444ae0 +R b57102997b3962a96160f5f593dc69e1 U drh -Z 6414db32510ab8f356b11e69a29d6be4 +Z 1fcaecaf5799b220b4fbf66eb096e19d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7c9c1ef877..0d5bba483b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2cf6518140d61e2123dc20f39d7e97e7bce17e7641405df7fd63e1cdda444ae0 \ No newline at end of file +cff293b0a79107def7bfe54fd60ac4a721c5098c85229d9b46a4e2c4cbf34a6a \ No newline at end of file diff --git a/src/date.c b/src/date.c index 6c1acaa9ae..360f9a57b6 100644 --- a/src/date.c +++ b/src/date.c @@ -1380,6 +1380,10 @@ static void cdateFunc( ** date/time values A and B, the following invariant should hold: ** ** datetime(A) == (datetime(B, timediff(A,B)) +** +** Both DATE arguments must be either a julian day number, or an +** ISO-8601 string. The unix timestamps are not supported by this +** routine. */ static void timediffFunc( sqlite3_context *context, @@ -1393,10 +1397,6 @@ static void timediffFunc( int Y, M; if( isDate(context, 1, argv, &d1) ) return; if( isDate(context, 1, &argv[1], &d2) ) return; - autoAdjustDate(&d1); - computeJD(&d1); - autoAdjustDate(&d2); - computeJD(&d2); pOut = sqlite3_str_new(sqlite3_context_db_handle(context)); if( pOut==0 ){ sqlite3_result_error_nomem(context); @@ -1415,7 +1415,6 @@ static void timediffFunc( M = d1.M - d2.M; if( M<0 ){ Y--; - d2.Y--; M += 12; } if( M!=0 ){ @@ -1450,7 +1449,6 @@ static void timediffFunc( M = d2.M - d1.M; if( M<0 ){ Y--; - d2.Y--; M += 12; } if( M!=0 ){ diff --git a/test/timediff1.test b/test/timediff1.test index b9a38b9c52..07d50713f6 100644 --- a/test/timediff1.test +++ b/test/timediff1.test @@ -81,7 +81,7 @@ unset -nocomplain p2 set p1 { 1 {0000-01-01 12:34:56} 2 {1776-07-04 13:00:00} - 3 {-275529600} + 3 {1969-07-20 20:17} 4 {2440587.5} 5 {2000-05-29 14:26} 6 {2023-05-29 18:11} @@ -93,17 +93,19 @@ set p2 { C {2000-02-29 13:00} D {2005-04-30 23:59:59} E {2005-05-01} + F {1066-10-14} + G {1904-02-29 11:25} } foreach {x1 d1} $p1 { foreach {x2 d2} $p2 { set r1 [db one {SELECT datetime($d1,'auto')}] do_execsql_test timediff-4-$x1$x2 { - SELECT datetime($d2, timediff($d1,$d2)); + SELECT datetime($d2, 'auto', timediff($d1,$d2)); } [list $r1] set r2 [db one {SELECT datetime($d2,'auto')}] do_execsql_test timediff-4-$x2$x1 { - SELECT datetime($d1, timediff($d2,$d1)); + SELECT datetime($d1, 'auto', timediff($d2,$d1)); } [list $r2] } }