1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Update date/time functions so that they correctly handle NULL arguments. (CVS 1147)

FossilOrigin-Name: a5a5fbd60153dd068ec2559455146e84da075b90
This commit is contained in:
drh
2003-12-23 16:34:12 +00:00
parent 7091cb0566
commit f586aa8b96
4 changed files with 34 additions and 14 deletions

View File

@ -11,7 +11,7 @@
# 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
@ -152,4 +152,24 @@ if {[clock format 0 -format %Z]=="EST"} {
{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