/ Check-in [51ec0e54]
Login

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

Overview
Comment:Remove the unused xRename() method from the sqlite3_vfs object. Add better documentation on the xCurrentTimeInt64() method.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:51ec0e5432dd6849b83a3d969a018482eb3bb083
User & Date: drh 2010-07-03 17:13:32
Context
2010-07-03
19:08
Do not run the memsubsys1.test script under the memsubsys1 permutation. check-in: 3a1a8c77 user: dan tags: trunk
17:13
Remove the unused xRename() method from the sqlite3_vfs object. Add better documentation on the xCurrentTimeInt64() method. check-in: 51ec0e54 user: drh tags: trunk
16:37
Further changes to test scripts so that the "inmemory_journal" permutation works. check-in: 50f2f7df user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  6080   6080       unixDlError,          /* xDlError */                    \
  6081   6081       unixDlSym,            /* xDlSym */                      \
  6082   6082       unixDlClose,          /* xDlClose */                    \
  6083   6083       unixRandomness,       /* xRandomness */                 \
  6084   6084       unixSleep,            /* xSleep */                      \
  6085   6085       unixCurrentTime,      /* xCurrentTime */                \
  6086   6086       unixGetLastError,     /* xGetLastError */               \
  6087         -    0,                    /* xRename */                     \
  6088   6087       unixCurrentTimeInt64, /* xCurrentTimeInt64 */           \
  6089   6088     }
  6090   6089   
  6091   6090     /*
  6092   6091     ** All default VFSes for unix are contained in the following array.
  6093   6092     **
  6094   6093     ** Note that the sqlite3_vfs.pNext field of the VFS object is modified

Changes to src/os_win.c.

  2474   2474       winDlError,          /* xDlError */
  2475   2475       winDlSym,            /* xDlSym */
  2476   2476       winDlClose,          /* xDlClose */
  2477   2477       winRandomness,       /* xRandomness */
  2478   2478       winSleep,            /* xSleep */
  2479   2479       winCurrentTime,      /* xCurrentTime */
  2480   2480       winGetLastError,     /* xGetLastError */
  2481         -    0,                   /* xRename */
  2482   2481       winCurrentTimeInt64, /* xCurrentTimeInt64 */
  2483   2482     };
  2484   2483   
  2485   2484     sqlite3_vfs_register(&winVfs, 1);
  2486   2485     return SQLITE_OK; 
  2487   2486   }
  2488   2487   int sqlite3_os_end(void){ 
  2489   2488     return SQLITE_OK;
  2490   2489   }
  2491   2490   
  2492   2491   #endif /* SQLITE_OS_WIN */

Changes to src/sqlite.h.in.

   823    823   ** SQLite will always allocate at least mxPathname+1 bytes for the
   824    824   ** output buffer xFullPathname.  The exact size of the output buffer
   825    825   ** is also passed as a parameter to both  methods. If the output buffer
   826    826   ** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
   827    827   ** handled as a fatal error by SQLite, vfs implementations should endeavor
   828    828   ** to prevent this by setting mxPathname to a sufficiently large value.
   829    829   **
   830         -** The xRandomness(), xSleep(), and xCurrentTime() interfaces
   831         -** are not strictly a part of the filesystem, but they are
          830  +** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
          831  +** interfaces are not strictly a part of the filesystem, but they are
   832    832   ** included in the VFS structure for completeness.
   833    833   ** The xRandomness() function attempts to return nBytes bytes
   834    834   ** of good-quality randomness into zOut.  The return value is
   835    835   ** the actual number of bytes of randomness obtained.
   836    836   ** The xSleep() method causes the calling thread to sleep for at
   837    837   ** least the number of microseconds given.  The xCurrentTime()
   838         -** method returns a Julian Day Number for the current date and time.
   839         -**
          838  +** method returns a Julian Day Number for the current date and time as
          839  +** a floating point value.
          840  +** The xCurrentTimeInt64() method returns, as an integer, the Julian
          841  +** Day Number multipled by 86400000 (the number of milliseconds in 
          842  +** a 24-hour day).  
          843  +** ^SQLite will use the xCurrentTimeInt64() method to get the current
          844  +** date and time if that method is available (if iVersion is 2 or 
          845  +** greater and the function pointer is not NULL) and will fall back
          846  +** to xCurrentTime() if xCurrentTimeInt64() is unavailable.
   840    847   */
   841    848   typedef struct sqlite3_vfs sqlite3_vfs;
   842    849   struct sqlite3_vfs {
   843    850     int iVersion;            /* Structure version number (currently 2) */
   844    851     int szOsFile;            /* Size of subclassed sqlite3_file */
   845    852     int mxPathname;          /* Maximum file pathname length */
   846    853     sqlite3_vfs *pNext;      /* Next registered VFS */
................................................................................
   859    866     int (*xSleep)(sqlite3_vfs*, int microseconds);
   860    867     int (*xCurrentTime)(sqlite3_vfs*, double*);
   861    868     int (*xGetLastError)(sqlite3_vfs*, int, char *);
   862    869     /*
   863    870     ** The methods above are in version 1 of the sqlite_vfs object
   864    871     ** definition.  Those that follow are added in version 2 or later
   865    872     */
   866         -  int (*xRename)(sqlite3_vfs*, const char *zOld, const char *zNew, int dirSync);
   867    873     int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
   868    874     /*
   869    875     ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
   870    876     ** New fields may be appended in figure versions.  The iVersion
   871    877     ** value will increment whenever this happens. 
   872    878     */
   873    879   };

Changes to src/test6.c.

   809    809       cfDlError,            /* xDlError */
   810    810       cfDlSym,              /* xDlSym */
   811    811       cfDlClose,            /* xDlClose */
   812    812       cfRandomness,         /* xRandomness */
   813    813       cfSleep,              /* xSleep */
   814    814       cfCurrentTime,        /* xCurrentTime */
   815    815       0,                    /* xGetlastError */
   816         -    0,                    /* xRename */
   817    816       0,                    /* xCurrentTimeInt64 */
   818    817     };
   819    818   
   820    819     if( objc!=2 ){
   821    820       Tcl_WrongNumArgs(interp, 1, objv, "ENABLE");
   822    821       return TCL_ERROR;
   823    822     }

Changes to src/test_devsym.c.

    95     95     0,                        /* xDlSym */
    96     96     0,                        /* xDlClose */
    97     97   #endif /* SQLITE_OMIT_LOAD_EXTENSION */
    98     98     devsymRandomness,         /* xRandomness */
    99     99     devsymSleep,              /* xSleep */
   100    100     devsymCurrentTime,        /* xCurrentTime */
   101    101     0,                        /* xGetLastError */
   102         -  0,                        /* xRename */
   103    102     0                         /* xCurrentTimeInt64 */
   104    103   };
   105    104   
   106    105   static sqlite3_io_methods devsym_io_methods = {
   107    106     2,                                /* iVersion */
   108    107     devsymClose,                      /* xClose */
   109    108     devsymRead,                       /* xRead */

Changes to src/test_journal.c.

   178    178     jtDlError,                     /* xDlError */
   179    179     jtDlSym,                       /* xDlSym */
   180    180     jtDlClose,                     /* xDlClose */
   181    181     jtRandomness,                  /* xRandomness */
   182    182     jtSleep,                       /* xSleep */
   183    183     jtCurrentTime,                 /* xCurrentTime */
   184    184     0,                             /* xGetLastError */
   185         -  0,                             /* xRename */
   186    185     jtCurrentTimeInt64             /* xCurrentTimeInt64 */
   187    186   };
   188    187   
   189    188   static sqlite3_io_methods jt_io_methods = {
   190    189     1,                             /* iVersion */
   191    190     jtClose,                       /* xClose */
   192    191     jtRead,                        /* xRead */

Changes to src/test_onefile.c.

   195    195       fsDlOpen,                                   /* xDlOpen */
   196    196       fsDlError,                                  /* xDlError */
   197    197       fsDlSym,                                    /* xDlSym */
   198    198       fsDlClose,                                  /* xDlClose */
   199    199       fsRandomness,                               /* xRandomness */
   200    200       fsSleep,                                    /* xSleep */
   201    201       fsCurrentTime,                              /* xCurrentTime */
   202         -    0,                                          /* xRename */
   203    202       0                                           /* xCurrentTimeInt64 */
   204    203     }, 
   205    204     0,                                            /* pFileList */
   206    205     0                                             /* pParent */
   207    206   };
   208    207   
   209    208   static sqlite3_io_methods fs_io_methods = {

Changes to src/test_osinst.c.

    18     18   /*
    19     19   ** This module contains code for a wrapper VFS that causes a log of
    20     20   ** most VFS calls to be written into a nominated file on disk. The log 
    21     21   ** is stored in a compressed binary format to reduce the amount of IO 
    22     22   ** overhead introduced into the application by logging.
    23     23   **
    24     24   ** All calls on sqlite3_file objects except xFileControl() are logged.
    25         -** Additionally, calls to the xAccess(), xOpen(), xDelete() and xRename() 
           25  +** Additionally, calls to the xAccess(), xOpen(), and xDelete()
    26     26   ** methods are logged. The other sqlite3_vfs object methods (xDlXXX,
    27     27   ** xRandomness, xSleep, xCurrentTime, xGetLastError and xCurrentTimeInt64) 
    28     28   ** are not logged.
    29     29   **
    30     30   ** The binary log files are read using a virtual table implementation
    31     31   ** also contained in this file. 
    32     32   **
................................................................................
   167    167   static void (*vfslogDlSym(sqlite3_vfs *pVfs, void *p, const char*zSym))(void);
   168    168   static void vfslogDlClose(sqlite3_vfs*, void*);
   169    169   static int vfslogRandomness(sqlite3_vfs*, int nByte, char *zOut);
   170    170   static int vfslogSleep(sqlite3_vfs*, int microseconds);
   171    171   static int vfslogCurrentTime(sqlite3_vfs*, double*);
   172    172   
   173    173   static int vfslogGetLastError(sqlite3_vfs*, int, char *);
   174         -static int vfslogRename(sqlite3_vfs*, const char *, const char *, int);
   175    174   static int vfslogCurrentTimeInt64(sqlite3_vfs*, sqlite3_int64*);
   176    175   
   177    176   static sqlite3_vfs vfslog_vfs = {
   178    177     1,                              /* iVersion */
   179    178     sizeof(VfslogFile),             /* szOsFile */
   180    179     INST_MAX_PATHNAME,              /* mxPathname */
   181    180     0,                              /* pNext */
................................................................................
   189    188     vfslogDlError,                  /* xDlError */
   190    189     vfslogDlSym,                    /* xDlSym */
   191    190     vfslogDlClose,                  /* xDlClose */
   192    191     vfslogRandomness,               /* xRandomness */
   193    192     vfslogSleep,                    /* xSleep */
   194    193     vfslogCurrentTime,              /* xCurrentTime */
   195    194     vfslogGetLastError,             /* xGetLastError */
   196         -  vfslogRename,                   /* xRename */
   197    195     vfslogCurrentTimeInt64          /* xCurrentTime */
   198    196   };
   199    197   
   200    198   static sqlite3_io_methods vfslog_io_methods = {
   201    199     2,                              /* iVersion */
   202    200     vfslogClose,                    /* xClose */
   203    201     vfslogRead,                     /* xRead */
................................................................................
   612    610   static int vfslogCurrentTime(sqlite3_vfs *pVfs, double *pTimeOut){
   613    611     return REALVFS(pVfs)->xCurrentTime(REALVFS(pVfs), pTimeOut);
   614    612   }
   615    613   
   616    614   static int vfslogGetLastError(sqlite3_vfs *pVfs, int a, char *b){
   617    615     return REALVFS(pVfs)->xGetLastError(REALVFS(pVfs), a, b);
   618    616   }
   619         -static int vfslogRename(sqlite3_vfs *pVfs, const char *a, const char *b, int c){
   620         -  return REALVFS(pVfs)->xRename(REALVFS(pVfs), a, b, c);
   621         -}
   622    617   static int vfslogCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *p){
   623    618     return REALVFS(pVfs)->xCurrentTimeInt64(REALVFS(pVfs), p);
   624    619   }
   625    620   
   626    621   static void vfslog_flush(VfslogVfs *p){
   627    622   #ifdef SQLITE_TEST
   628    623     extern int sqlite3_io_error_pending;

Changes to src/test_vfs.c.

  1292   1292       0,                            /* xDlSym */
  1293   1293       0,                            /* xDlClose */
  1294   1294   #endif /* SQLITE_OMIT_LOAD_EXTENSION */
  1295   1295       tvfsRandomness,               /* xRandomness */
  1296   1296       tvfsSleep,                    /* xSleep */
  1297   1297       tvfsCurrentTime,              /* xCurrentTime */
  1298   1298       0,                            /* xGetLastError */
  1299         -    0,
  1300         -    0,
         1299  +    0,                            /* xCurrentTimeInt64 */
  1301   1300     };
  1302   1301   
  1303   1302     Testvfs *p;                     /* New object */
  1304   1303     sqlite3_vfs *pVfs;              /* New VFS */
  1305   1304     char *zVfs;
  1306   1305     int nByte;                      /* Bytes of space to allocate at p */
  1307   1306