From: shane Date: Tue, 20 May 2008 14:01:59 +0000 (+0000) Subject: Added more DST boundary checks for 2006 and 2007. Added check for suspect Windows... X-Git-Tag: version-3.6.10~1030 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05eaf73c8c7004b526f10e4e8f75002bed1c86c4;p=thirdparty%2Fsqlite.git Added more DST boundary checks for 2006 and 2007. Added check for suspect Windows DST implementations and warning about them. Ticket #2322. (CVS 5147) FossilOrigin-Name: 14226ff0a7af7b39a1089a17eeb5bbb8d09d778d --- diff --git a/manifest b/manifest index 6f36dc4e0b..1a1d2b28b8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Updated\stest\scase\sfor\sWindows\sto\sget\saround\sproblems\sin\sticket\s#3129.\s(CVS\s5146) -D 2008-05-20T13:17:28 +C Added\smore\sDST\sboundary\schecks\sfor\s2006\sand\s2007.\s\sAdded\scheck\sfor\ssuspect\sWindows\sDST\simplementations\sand\swarning\sabout\sthem.\s\sTicket\s#2322.\s(CVS\s5147) +D 2008-05-20T14:01:59 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in 79aeba12300a54903f1b1257c1e7c190234045dd F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -244,7 +244,7 @@ F test/crash7.test e20a7b9ee1d16eaef7c94a4cb7ed2191b4d05970 F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2 F test/createtab.test 199cf68f44e5d9e87a0b8afc7130fdeb4def3272 F test/cse.test 4b8a49decaefccb835ecc67249277be491713f6c -F test/date.test be0a3a30f5009b1cbc1a9c396b1fe96bd18522cc +F test/date.test a1554e1af11fd8a4c150013a53713605f2499bde F test/default.test 252298e42a680146b1dd64f563b95bdf088d94fb F test/delete.test f171c1011395a8dd63169438fe1d8cc625eb7442 F test/delete2.test c06be3806ba804bc8c6f134476816080280b40e3 @@ -636,7 +636,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P ffd4e50ab9b14fb7b686681c5e7a37b8355bbfca -R 12b715aa174c70b8d935ac606ddf1cf1 +P 2faf69ca1da43f8083b96675a4886648f10177d8 +R 6df5a2e7a1004d286b1e02fdd89d3f9d U shane -Z 21adfb2ee36b21344b385ac1ce33302a +Z 473f14dd2f4e8d627d9c50329fe96aff diff --git a/manifest.uuid b/manifest.uuid index 7985e91486..d54c470d87 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2faf69ca1da43f8083b96675a4886648f10177d8 \ No newline at end of file +14226ff0a7af7b39a1089a17eeb5bbb8d09d778d \ No newline at end of file diff --git a/test/date.test b/test/date.test index caeb5b134f..6c3f2751b4 100644 --- a/test/date.test +++ b/test/date.test @@ -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.26 2008/04/15 04:02:41 drh Exp $ +# $Id: date.test,v 1.27 2008/05/20 14:01:59 shane Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -222,24 +222,98 @@ datetest 5.15 {datetime('1994-04-16 14:00:00 +05:00 Z')} NULL # if the localtime is in the US Eastern Time (the time in Charlotte, NC # and in New York.) # -set tzoffset [db one { - SELECT CAST(24*(julianday('2006-09-01') - - julianday('2006-09-01','localtime'))+0.5 +# On non-Vista Windows platform, '2006-03-31' is treated incorrectly as being +# in DST giving a 4 hour offset instead of 5. In 2007, DST was extended to +# start three weeks earlier (second Sunday in March) and end one week +# later (first Sunday in November). Older Windows systems apply this +# new rule incorrectly to dates prior to 2007. +# +# It might be argued that this is masking a problem on non-Vista Windows +# platform. A ticket has already been opened for this issue +# (http://www.sqlite.org/cvstrac/tktview?tn=2322). This is just to prevent +# more confusion/reports of the issue. +# + +# $tzoffset_old should be 5 if DST is working correctly. +set tzoffset_old [db one { + SELECT CAST(24*(julianday('2006-03-31') - + julianday('2006-03-31','localtime'))+0.5 + AS INT) +}] + +# $tzoffset_new should be 4 if DST is working correctly. +set tzoffset_new [db one { + SELECT CAST(24*(julianday('2007-03-31') - + julianday('2007-03-31','localtime'))+0.5 AS INT) }] -if {$tzoffset==4} { + +# Warn about possibly broken Windows DST implementations. +if {$::tcl_platform(platform)=="windows" && $tzoffset_new==4 && $tzoffset_old==4} { + puts "******************************************************************" + puts "N.B.: The DST support provided by your current O/S seems to be" + puts "suspect in that it is reporting incorrect DST values for dates" + puts "prior to 2007. This is the known case for most (all?) non-Vista" + puts "Windows versions. Please see ticket #2322 for more information." + puts "******************************************************************" +} + +if {$tzoffset_new==4} { datetest 6.1 {datetime('2000-10-29 05:59:00','localtime')}\ {2000-10-29 01:59:00} - datetest 6.2 {datetime('2000-10-29 06:00:00','localtime')}\ - {2000-10-29 01:00:00} - datetest 6.3 {datetime('2000-04-02 06:59:00','localtime')}\ - {2000-04-02 01:59:00} + datetest 6.1.1 {datetime('2006-10-29 05:59:00','localtime')}\ + {2006-10-29 01:59:00} + datetest 6.1.2 {datetime('2007-11-04 05:59:00','localtime')}\ + {2007-11-04 01:59:00} + + # If the new and old DST rules seem to be working correctly... + if {$tzoffset_new==4 && $tzoffset_old==5} { + datetest 6.2 {datetime('2000-10-29 06:00:00','localtime')}\ + {2000-10-29 01:00:00} + datetest 6.2.1 {datetime('2006-10-29 06:00:00','localtime')}\ + {2006-10-29 01:00:00} + } + datetest 6.2.2 {datetime('2007-11-04 06:00:00','localtime')}\ + {2007-11-04 01:00:00} + + # If the new and old DST rules seem to be working correctly... + if {$tzoffset_new==4 && $tzoffset_old==5} { + datetest 6.3 {datetime('2000-04-02 06:59:00','localtime')}\ + {2000-04-02 01:59:00} + datetest 6.3.1 {datetime('2006-04-02 06:59:00','localtime')}\ + {2006-04-02 01:59:00} + } + datetest 6.3.2 {datetime('2007-03-11 07:00:00','localtime')}\ + {2007-03-11 03:00:00} + datetest 6.4 {datetime('2000-04-02 07:00:00','localtime')}\ {2000-04-02 03:00:00} + datetest 6.4.1 {datetime('2006-04-02 07:00:00','localtime')}\ + {2006-04-02 03:00:00} + datetest 6.4.2 {datetime('2007-03-11 07:00:00','localtime')}\ + {2007-03-11 03:00:00} + datetest 6.5 {datetime('2000-10-29 01:59:00','utc')} {2000-10-29 05:59:00} - datetest 6.6 {datetime('2000-10-29 02:00:00','utc')} {2000-10-29 07:00:00} - datetest 6.7 {datetime('2000-04-02 01:59:00','utc')} {2000-04-02 06:59:00} + datetest 6.5.1 {datetime('2006-10-29 01:59:00','utc')} {2006-10-29 05:59:00} + datetest 6.5.2 {datetime('2007-11-04 01:59:00','utc')} {2007-11-04 05:59:00} + + # If the new and old DST rules seem to be working correctly... + if {$tzoffset_new==4 && $tzoffset_old==5} { + datetest 6.6 {datetime('2000-10-29 02:00:00','utc')} {2000-10-29 07:00:00} + datetest 6.6.1 {datetime('2006-10-29 02:00:00','utc')} {2006-10-29 07:00:00} + } + datetest 6.6.2 {datetime('2007-11-04 02:00:00','utc')} {2007-11-04 07:00:00} + + # If the new and old DST rules seem to be working correctly... + if {$tzoffset_new==4 && $tzoffset_old==5} { + datetest 6.7 {datetime('2000-04-02 01:59:00','utc')} {2000-04-02 06:59:00} + datetest 6.7.1 {datetime('2006-04-02 01:59:00','utc')} {2006-04-02 06:59:00} + } + datetest 6.7.2 {datetime('2007-03-11 01:59:00','utc')} {2007-03-11 06:59:00} + datetest 6.8 {datetime('2000-04-02 02:00:00','utc')} {2000-04-02 06:00:00} + datetest 6.8.1 {datetime('2006-04-02 02:00:00','utc')} {2006-04-02 06:00:00} + datetest 6.8.2 {datetime('2007-03-11 02:00:00','utc')} {2007-03-11 06:00:00} datetest 6.10 {datetime('2000-01-01 12:00:00','localtime')} \ {2000-01-01 07:00:00} @@ -377,5 +451,4 @@ datetest 13.6 {strftime('%Y-%m-%d %H:%M:%S', '2007-01-01 23:59:59.6')} \ datetest 13.7 {strftime('%Y-%m-%d %H:%M:%f', '2007-01-01 23:59:59.6')} \ {2007-01-01 23:59:59.600} - finish_test