-C Add\slocaltime<-->UTC\sconversions\sto\sthe\sdate\sfunctions.\s(CVS\s1146)
-D 2003-12-23T16:22:18
+C Update\sdate/time\sfunctions\sso\sthat\sthey\scorrectly\shandle\sNULL\sarguments.\s(CVS\s1147)
+D 2003-12-23T16:34:13
F Makefile.in 0515ff9218ad8d5a8f6220f0494b8ef94c67013b
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F src/btree_rb.c e4084b6a12270674b0cd7034655f55e6a2639c78
F src/build.c a7493c433de5b552f9535d8fa7ed80aaf135491e
F src/copy.c 9e47975ea96751c658bcf1a0c4f0bb7c6ee61e73
-F src/date.c 1e3318d8450088f235442ca1cddd2601c0c32d1a
+F src/date.c a69da8995eec808151f7e82857cbfbc5c70309e3
F src/delete.c 0f81e6799c089487615d38e042a2de4d2d6192bc
F src/encode.c 25ea901a9cefb3d93774afa4a06b57cb58acf544
F src/expr.c a14401a54e5923f3e52b6d04a83813d150f43f33
F test/capi2.test ec96e0e235d87b53cbaef3d8e3e0f8ccf32c71ca
F test/conflict.test 0911bb2f079046914a6e9c3341b36658c4e2103e
F test/copy.test 88dabd4e811b17644b726aa81d404e73b7635c84
-F test/date.test 510cf3dbc0bc090fc28b2ae1bc290dcd920f5414
+F test/date.test 8fe7fab4e901c4bac2572058b3360a59f25d5f14
F test/delete.test 92256384f1801760180ded129f7427884cf28886
F test/expr.test c4cc292d601019c2f2ce95093caaa5d10284b105
F test/fkey1.test d65c824459916249bee501532d6154ddab0b5db7
F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
-P c6c5e07b65ae1c30117f0276a1002d5036697cf1
-R bb5987106040b561c6e78128774239d9
+P 8482b8c44766e7f80fc449b3dbdd3f37396c332b
+R 757f37c1931b5323149da11681dc8f61
U drh
-Z cdbbb6875dbb4ed10b1b0f72076527c5
+Z 97bbf0c2e5044cc3f77063234413c8db
-8482b8c44766e7f80fc449b3dbdd3f37396c332b
\ No newline at end of file
+a5a5fbd60153dd068ec2559455146e84da075b90
\ No newline at end of file
** sqliteRegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: date.c,v 1.3 2003/12/23 16:22:18 drh Exp $
+** $Id: date.c,v 1.4 2003/12/23 16:34:13 drh Exp $
**
** NOTES:
**
static int isDate(int argc, const char **argv, DateTime *p){
int i;
if( argc==0 ) return 1;
- if( parseDateOrTime(argv[0], p) ) return 1;
+ if( argv[0]==0 || parseDateOrTime(argv[0], p) ) return 1;
for(i=1; i<argc; i++){
- if( parseModifier(argv[i], p) ) return 1;
+ if( argv[i]==0 || parseModifier(argv[i], p) ) return 1;
}
return 0;
}
char *z;
const char *zFmt = argv[0];
char zBuf[100];
- if( isDate(argc-1, argv+1, &x) ) return;
+ if( argv[0]==0 || isDate(argc-1, argv+1, &x) ) return;
for(i=0, n=1; zFmt[i]; i++, n++){
if( zFmt[i]=='%' ){
switch( zFmt[i+1] ){
#ifndef SQLITE_OMIT_DATETIME_FUNCS
{ "julianday", -1, SQLITE_NUMERIC, juliandayFunc },
{ "date", -1, SQLITE_TEXT, dateFunc },
- { "time", 1, SQLITE_TEXT, timeFunc },
+ { "time", -1, SQLITE_TEXT, timeFunc },
{ "datetime", -1, SQLITE_TEXT, datetimeFunc },
{ "strftime", -1, SQLITE_TEXT, strftimeFunc },
#endif
# This file implements regression tests for SQLite library. The
# focus of this file is testing date and time functions.
#
-# $Id: date.test,v 1.2 2003/12/23 16:22:18 drh Exp $
+# $Id: date.test,v 1.3 2003/12/23 16:34:13 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
{2039-07-01 07:00:00}
}
+# Date-time functions that contain NULL arguments return a NULL
+# result.
+#
+datetest 7.1 {datetime(null)} NULL
+datetest 7.2 {datetime('now',null)} NULL
+datetest 7.3 {datetime('now','localtime',null)} NULL
+datetest 7.4 {time(null)} NULL
+datetest 7.5 {time('now',null)} NULL
+datetest 7.6 {time('now','localtime',null)} NULL
+datetest 7.7 {date(null)} NULL
+datetest 7.8 {date('now',null)} NULL
+datetest 7.9 {date('now','localtime',null)} NULL
+datetest 7.10 {julianday(null)} NULL
+datetest 7.11 {julianday('now',null)} NULL
+datetest 7.12 {julianday('now','localtime',null)} NULL
+datetest 7.13 {strftime(null,'now')} NULL
+datetest 7.14 {strftime('%s',null)} NULL
+datetest 7.15 {strftime('%s','now',null)} NULL
+datetest 7.16 {strftime('%s','now','localtime',null)} NULL
+
finish_test