From: drh Date: Thu, 12 Jun 2008 12:51:37 +0000 (+0000) Subject: Add the ability to disable the "localtime" modifier in the date/time X-Git-Tag: version-3.6.10~965 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66147c971577d270071e346afba6a08a6c134056;p=thirdparty%2Fsqlite.git Add the ability to disable the "localtime" modifier in the date/time functions. This might be necessary for systems that do not support localtime_r() or localtime_s(). (CVS 5212) FossilOrigin-Name: 12f3ba11e72b2310abf51d040d5344c81fe5ebd3 --- diff --git a/manifest b/manifest index feaf6fec11..f324c5c7fc 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sobsolete\scode\sfrom\sthe\stest_osinst.c\smodule.\s(CVS\s5211) -D 2008-06-12T12:40:14 +C Add\sthe\sability\sto\sdisable\sthe\s"localtime"\smodifier\sin\sthe\sdate/time\nfunctions.\s\sThis\smight\sbe\snecessary\sfor\ssystems\sthat\sdo\snot\ssupport\nlocaltime_r()\sor\slocaltime_s().\s(CVS\s5212) +D 2008-06-12T12:51:37 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in ce92ea8dc7adfb743757794f51c10d1b0d9c55e4 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -102,7 +102,7 @@ F src/btreeInt.h dc04ee33d8eb84714b2acdf81336fbbf6e764530 F src/build.c a52d9d51341444a2131e3431608f245db80d9591 F src/callback.c 77b302b0d41468dcda78c70e706e5b84577f0fa0 F src/complete.c 4cf68fd75d60257524cbe74f87351b9848399131 -F src/date.c b305ced9f4da66b51ef020d9bf31c6c92fc0c6bb +F src/date.c fd34fd6b95ba197a7edcf03f2d29bbad12627747 F src/delete.c d3fc5987f2eb88f7b9549d58a5dfea079a83fe8b F src/expr.c ecb3b23d3543427cba3e2ac12a6c6ae4bb20d39b F src/fault.c 1f6177188edb00641673e462f3fab8cba9f7422b @@ -160,7 +160,7 @@ F src/test9.c 4615ef08750245a2d96aaa7cbe2fb4aff2b57acc F src/test_async.c fb5ab7b54c0b4ece9e2283b9c38314ba5d40bab6 F src/test_autoext.c 5e892ab84aece3f0428920bf46923f16ac83962a F src/test_btree.c c1308ba0b88ab577fa56c9e493a09829dfcded9c -F src/test_config.c 982bba6221b854a86427ae64e9c65b313b0f6e03 +F src/test_config.c 0a2b732a6fd9cfef39417a303b76a402c963d89b F src/test_devsym.c 6012cb8e3acf812513511025a4fa5d626e0ba19b F src/test_func.c f4aafa10f17d52c43a64b47717265802e6e552b3 F src/test_hexio.c 2f1122aa3f012fa0142ee3c36ce5c902a70cd12f @@ -593,7 +593,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P b60508ccbc3159e994bc988512d9dbec3932deb6 -R 51ab164f50f582f0a145ce2a644a3770 +P 699cec66cdae6818844612d69eb89aa8b93c3f1a +R 6631b4e8e1eef0d904b1e969cd29169e U drh -Z 04a51ee536177a3891649a3a4a46bfd5 +Z c094251ed94ff85de9ce9595187c60d8 diff --git a/manifest.uuid b/manifest.uuid index 26215908f0..2232635a7e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -699cec66cdae6818844612d69eb89aa8b93c3f1a \ No newline at end of file +12f3ba11e72b2310abf51d040d5344c81fe5ebd3 \ No newline at end of file diff --git a/src/date.c b/src/date.c index c90543ff51..9831541808 100644 --- a/src/date.c +++ b/src/date.c @@ -16,7 +16,7 @@ ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: date.c,v 1.80 2008/05/27 19:49:21 shane Exp $ +** $Id: date.c,v 1.81 2008/06/12 12:51:37 drh Exp $ ** ** SQLite processes all times and dates as Julian Day numbers. The ** dates and times are stored as the number of days since noon @@ -416,6 +416,7 @@ static void clearYMD_HMS_TZ(DateTime *p){ p->validTZ = 0; } +#ifndef SQLITE_OMIT_LOCALTIME /* ** Compute the difference (in days) between localtime and UTC (a.k.a. GMT) ** for the time value p where p is in UTC. @@ -483,6 +484,7 @@ static double localtimeOffset(DateTime *p){ computeJD(&y); return y.rJD - x.rJD; } +#endif /* SQLITE_OMIT_LOCALTIME */ /* ** Process a modifier to a date-time stamp. The modifiers are @@ -516,6 +518,7 @@ static int parseModifier(const char *zMod, DateTime *p){ } z[n] = 0; switch( z[0] ){ +#ifndef SQLITE_OMIT_LOCALTIME case 'l': { /* localtime ** @@ -530,6 +533,7 @@ static int parseModifier(const char *zMod, DateTime *p){ } break; } +#endif case 'u': { /* ** unixepoch diff --git a/src/test_config.c b/src/test_config.c index b1f23b9419..50fe594950 100644 --- a/src/test_config.c +++ b/src/test_config.c @@ -16,7 +16,7 @@ ** The focus of this file is providing the TCL testing layer ** access to compile-time constants. ** -** $Id: test_config.c,v 1.26 2008/05/26 18:41:54 danielk1977 Exp $ +** $Id: test_config.c,v 1.27 2008/06/12 12:51:37 drh Exp $ */ #include "sqliteLimit.h" @@ -285,6 +285,12 @@ static void set_options(Tcl_Interp *interp){ Tcl_SetVar2(interp, "sqlite_options", "load_ext", "1", TCL_GLOBAL_ONLY); #endif +#ifdef SQLITE_OMIT_LOCALTIME + Tcl_SetVar2(interp, "sqlite_options", "localtime", "0", TCL_GLOBAL_ONLY); +#else + Tcl_SetVar2(interp, "sqlite_options", "localtime", "1", TCL_GLOBAL_ONLY); +#endif + Tcl_SetVar2(interp, "sqlite_options", "long_double", sizeof(LONGDOUBLE_TYPE)>sizeof(double) ? "1" : "0", TCL_GLOBAL_ONLY);