/ Check-in [b0323132]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Do not use double unnecessarily in date+time functions. Ticket #3422. (CVS 5776)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b03231323a7f06c736c38ae3c5535d2fd025583f
User & Date: drh 2008-10-07 12:32:13
Context
2008-10-07
14:06
Have sqlite3_bind_value() call sqlite3ApiExit() before returning. Otherwise the db->mallocFailed flag may not be cleared. (CVS 5777) check-in: 6b7c8d56 user: danielk1977 tags: trunk
12:32
Do not use double unnecessarily in date+time functions. Ticket #3422. (CVS 5776) check-in: b0323132 user: drh tags: trunk
11:51
Fix a problem with hot-journal rollback. SQLITE_CANTOPEN was being returned if the hot-journal file contained a pointer to a master journal file that did not exist. (CVS 5775) check-in: 22d1feb9 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/date.c.

    12     12   ** This file contains the C functions that implement date and time
    13     13   ** functions for SQLite.  
    14     14   **
    15     15   ** There is only one exported symbol in this file - the function
    16     16   ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
    17     17   ** All other code has file scope.
    18     18   **
    19         -** $Id: date.c,v 1.90 2008/09/03 17:11:16 drh Exp $
           19  +** $Id: date.c,v 1.91 2008/10/07 12:32:13 drh Exp $
    20     20   **
    21     21   ** SQLite processes all times and dates as Julian Day numbers.  The
    22     22   ** dates and times are stored as the number of days since noon
    23     23   ** in Greenwich on November 24, 4714 B.C. according to the Gregorian
    24     24   ** calendar system. 
    25     25   **
    26     26   ** 1970-01-01 00:00:00 is JD 2440587.5
................................................................................
   552    552         if( strcmp(z, "unixepoch")==0 && p->validJD ){
   553    553           p->iJD = p->iJD/86400.0 + 2440587.5*86400000.0;
   554    554           clearYMD_HMS_TZ(p);
   555    555           rc = 0;
   556    556         }
   557    557   #ifndef SQLITE_OMIT_LOCALTIME
   558    558         else if( strcmp(z, "utc")==0 ){
   559         -        double c1;
          559  +        int c1;
   560    560           computeJD(p);
   561    561           c1 = localtimeOffset(p);
   562    562           p->iJD -= c1;
   563    563           clearYMD_HMS_TZ(p);
   564    564           p->iJD += c1 - localtimeOffset(p);
   565    565           rc = 0;
   566    566         }