1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Problems fixed. All tests are passing now.

FossilOrigin-Name: cff293b0a79107def7bfe54fd60ac4a721c5098c85229d9b46a4e2c4cbf34a6a
This commit is contained in:
drh
2023-05-30 02:50:32 +00:00
parent 6abbef89e6
commit 36a5f1e90c
4 changed files with 17 additions and 17 deletions

View File

@@ -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 ){