-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
+C Avoid\sunnecessary\sfloat->text->float\sconversions\sin\sdate/time\sprocessing.\nThis\schange\snecessary\sto\sreproduce\sthe\sproblem\sreported\sby\sBareFoot.\s(CVS\s5213)
+D 2008-06-12T13:50:00
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in ce92ea8dc7adfb743757794f51c10d1b0d9c55e4
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/build.c a52d9d51341444a2131e3431608f245db80d9591
F src/callback.c 77b302b0d41468dcda78c70e706e5b84577f0fa0
F src/complete.c 4cf68fd75d60257524cbe74f87351b9848399131
-F src/date.c fd34fd6b95ba197a7edcf03f2d29bbad12627747
+F src/date.c 95d742c3fbbcccb3bf89e1acfaf90c9626e37592
F src/delete.c d3fc5987f2eb88f7b9549d58a5dfea079a83fe8b
F src/expr.c ecb3b23d3543427cba3e2ac12a6c6ae4bb20d39b
F src/fault.c 1f6177188edb00641673e462f3fab8cba9f7422b
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 699cec66cdae6818844612d69eb89aa8b93c3f1a
-R 6631b4e8e1eef0d904b1e969cd29169e
+P 12f3ba11e72b2310abf51d040d5344c81fe5ebd3
+R bb5746ef6e6bfc89c8a8599c4be75f8d
U drh
-Z c094251ed94ff85de9ce9595187c60d8
+Z 2295630320c454b579b6d344ea7e8948
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: date.c,v 1.81 2008/06/12 12:51:37 drh Exp $
+** $Id: date.c,v 1.82 2008/06/12 13:50:00 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
return 0;
}
+/*
+** Set the time to the current time reported by the VFS
+*/
+static void setDateTimeToCurrent(sqlite3_context *context, DateTime *p){
+ double r;
+ sqlite3 *db = sqlite3_context_db_handle(context);
+ sqlite3OsCurrentTime(db->pVfs, &r);
+ p->rJD = r;
+ p->validJD = 1;
+}
+
/*
** Attempt to parse the given string into a Julian Day Number. Return
** the number of errors.
}else if( parseHhMmSs(zDate, p)==0 ){
return 0;
}else if( sqlite3StrICmp(zDate,"now")==0){
- double r;
- sqlite3 *db = sqlite3_context_db_handle(context);
- sqlite3OsCurrentTime(db->pVfs, &r);
- p->rJD = r;
- p->validJD = 1;
+ setDateTimeToCurrent(context, p);
return 0;
}else if( sqlite3IsNumber(zDate, 0, SQLITE_UTF8) ){
getValue(zDate, &p->rJD);
){
int i;
const unsigned char *z;
- static const unsigned char zDflt[] = "now";
+ memset(p, 0, sizeof(*p));
if( argc==0 ){
- z = zDflt;
+ setDateTimeToCurrent(context, p);
+ }else if( sqlite3_value_type(argv[0])==SQLITE_FLOAT ){
+ memset(p, 0, sizeof(*p));
+ p->rJD = sqlite3_value_double(argv[0]);
+ p->validJD = 1;
}else{
z = sqlite3_value_text(argv[0]);
- }
- if( !z || parseDateOrTime(context, (char*)z, p) ){
- return 1;
+ if( !z || parseDateOrTime(context, (char*)z, p) ){
+ return 1;
+ }
}
for(i=1; i<argc; i++){
if( (z = sqlite3_value_text(argv[i]))==0 || parseModifier((char*)z, p) ){