/ Check-in [c3f91645]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix the SQLITE_OMIT_DATETIME_FUNCS compile-time option so that it builds successfully. (CVS 5815)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c3f91645159511250c9f86c2a97d819f0253d182
User & Date: drh 2008-10-13 15:35:09
Context
2008-10-13
17:09
Get the load extension tests working on amd64. Needed for test coverage. (CVS 5816) check-in: 119b69fb user: drh tags: trunk
15:35
Fix the SQLITE_OMIT_DATETIME_FUNCS compile-time option so that it builds successfully. (CVS 5815) check-in: c3f91645 user: drh tags: trunk
14:16
In rollback.test, do not check for journal deletion if the journal mode is not DELETE. Call show_memstats after each test module in all.test and quick.test. (CVS 5814) check-in: df2c28dc user: drh 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.91 2008/10/07 12:32:13 drh Exp $
           19  +** $Id: date.c,v 1.92 2008/10/13 15:35:09 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
................................................................................
  1060   1060       FUNCTION(time,             -1, 0, 0, timeFunc      ),
  1061   1061       FUNCTION(datetime,         -1, 0, 0, datetimeFunc  ),
  1062   1062       FUNCTION(strftime,         -1, 0, 0, strftimeFunc  ),
  1063   1063       FUNCTION(current_time,      0, 0, 0, ctimeFunc     ),
  1064   1064       FUNCTION(current_timestamp, 0, 0, 0, ctimestampFunc),
  1065   1065       FUNCTION(current_date,      0, 0, 0, cdateFunc     ),
  1066   1066   #else
  1067         -    FUNCTION(current_time,      0, "%H:%M:%S",          0, currentTimeFunc),
  1068         -    FUNCTION(current_timestamp, 0, "%Y-%m-%d",          0, currentTimeFunc),
  1069         -    FUNCTION(current_date,      0, "%Y-%m-%d %H:%M:%S", 0, currentTimeFunc),
         1067  +    STR_FUNCTION(current_time,      0, "%H:%M:%S",          0, currentTimeFunc),
         1068  +    STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d",          0, currentTimeFunc),
         1069  +    STR_FUNCTION(current_date,      0, "%Y-%m-%d %H:%M:%S", 0, currentTimeFunc),
  1070   1070   #endif
  1071   1071     };
  1072   1072     int i;
  1073   1073     FuncDefHash *pHash = &GLOBAL(FuncDefHash, sqlite3GlobalFunctions);
  1074   1074     FuncDef *aFunc = (FuncDef*)&GLOBAL(FuncDef, aDateTimeFuncs);
  1075   1075   
  1076   1076     for(i=0; i<ArraySize(aDateTimeFuncs); i++){
  1077   1077       sqlite3FuncDefInsert(pHash, &aFunc[i]);
  1078   1078     }
  1079   1079   }

Changes to src/sqliteInt.h.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Internal interface definitions for SQLite.
    13     13   **
    14         -** @(#) $Id: sqliteInt.h,v 1.783 2008/10/11 18:11:21 drh Exp $
           14  +** @(#) $Id: sqliteInt.h,v 1.784 2008/10/13 15:35:09 drh Exp $
    15     15   */
    16     16   #ifndef _SQLITEINT_H_
    17     17   #define _SQLITEINT_H_
    18     18   
    19     19   /*
    20     20   ** Include the configuration header output by 'configure' if we're using the
    21     21   ** autoconf-based build
................................................................................
   844    844   **     function likeFunc. Argument pArg is cast to a (void *) and made
   845    845   **     available as the function user-data (sqlite3_user_data()). The
   846    846   **     FuncDef.flags variable is set to the value passed as the flags
   847    847   **     parameter.
   848    848   */
   849    849   #define FUNCTION(zName, nArg, iArg, bNC, xFunc) \
   850    850     {nArg, SQLITE_UTF8, bNC*8, SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName}
          851  +#define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \
          852  +  {nArg, SQLITE_UTF8, bNC*8, pArg, 0, xFunc, 0, 0, #zName}
   851    853   #define LIKEFUNC(zName, nArg, arg, flags) \
   852    854     {nArg, SQLITE_UTF8, flags, (void *)arg, 0, likeFunc, 0, 0, #zName}
   853    855   #define AGGREGATE(zName, nArg, arg, nc, xStep, xFinal) \
   854    856     {nArg, SQLITE_UTF8, nc*8, SQLITE_INT_TO_PTR(arg), 0, 0, xStep,xFinal, #zName}
   855    857   
   856    858   
   857    859   /*

Changes to tool/omittest.tcl.

     1      1   
     2         -set rcsid {$Id: omittest.tcl,v 1.7 2008/08/22 13:57:39 pweilbacher Exp $}
            2  +set rcsid {$Id: omittest.tcl,v 1.8 2008/10/13 15:35:09 drh Exp $}
     3      3   
     4      4   # Documentation for this script. This may be output to stderr
     5      5   # if the script is invoked incorrectly.
     6      6   set ::USAGE_MESSAGE {
     7      7   This Tcl script is used to test the various compile time options 
     8      8   available for omitting code (the SQLITE_OMIT_xxx options). It
     9      9   should be invoked as follows:
................................................................................
    43     43   # when doing so. For example:
    44     44   #
    45     45   #     run_quick_test /tmp/testdir {SQLITE_OMIT_TRIGGER SQLITE_OMIT_VIEW}
    46     46   #
    47     47   #
    48     48   proc run_quick_test {dir omit_symbol_list} {
    49     49     # Compile the value of the OPTS Makefile variable.
    50         -  set opts "-DSQLITE_MEMDEBUG -DSQLITE_DEBUG" 
           50  +  set opts "-DSQLITE_MEMDEBUG -DSQLITE_DEBUG -DSQLITE_NO_SYNC" 
    51     51     if {$::tcl_platform(platform)=="windows"} {
    52     52       append opts " -DSQLITE_OS_WIN=1"
    53     53     } elseif {$::tcl_platform(platform)=="os2"} {
    54     54       append opts " -DSQLITE_OS_OS2=1"
    55     55     } else {
    56     56       append opts " -DSQLITE_OS_UNIX=1"
    57     57     }
................................................................................
   151    151       SQLITE_OMIT_CAST                   \
   152    152       SQLITE_OMIT_CHECK                  \
   153    153       SQLITE_OMIT_COMPLETE               \
   154    154       SQLITE_OMIT_COMPOUND_SELECT        \
   155    155       SQLITE_OMIT_CONFLICT_CLAUSE        \
   156    156       SQLITE_OMIT_DATETIME_FUNCS         \
   157    157       SQLITE_OMIT_DECLTYPE               \
   158         -    SQLITE_OMIT_DISKIO                 \
          158  +    off_SQLITE_OMIT_DISKIO                 \
   159    159       SQLITE_OMIT_EXPLAIN                \
   160    160       SQLITE_OMIT_FLAG_PRAGMAS           \
   161    161       SQLITE_OMIT_FLOATING_POINT         \
   162    162       SQLITE_OMIT_FOREIGN_KEY            \
   163    163       SQLITE_OMIT_GET_TABLE              \
   164    164       SQLITE_OMIT_GLOBALRECOVER          \
   165    165       SQLITE_OMIT_INCRBLOB               \
................................................................................
   166    166       SQLITE_OMIT_INTEGRITY_CHECK        \
   167    167       SQLITE_OMIT_LIKE_OPTIMIZATION      \
   168    168       SQLITE_OMIT_LOAD_EXTENSION         \
   169    169       SQLITE_OMIT_LOCALTIME              \
   170    170       SQLITE_OMIT_MEMORYDB               \
   171    171       SQLITE_OMIT_OR_OPTIMIZATION        \
   172    172       SQLITE_OMIT_PAGER_PRAGMAS          \
   173         -    SQLITE_OMIT_PARSER                 \
   174    173       SQLITE_OMIT_PRAGMA                 \
   175    174       SQLITE_OMIT_PROGRESS_CALLBACK      \
   176    175       SQLITE_OMIT_QUICKBALANCE           \
   177    176       SQLITE_OMIT_REINDEX                \
   178    177       SQLITE_OMIT_SCHEMA_PRAGMAS         \
   179    178       SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS \
   180    179       SQLITE_OMIT_SHARED_CACHE           \