Changeset: af1446786c9a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=af1446786c9a
Added Files:
        common/utils/strptime.c
Removed Files:
        
sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.err.Windows
        
sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.out.Windows
Modified Files:
        NT/Makefile
        NT/installer32/MonetDB-ODBC-Installer.vdproj
        NT/installer32/MonetDB5-Geom-Module.vdproj
        NT/installer32/MonetDB5-SQL-Installer.vdproj
        NT/installer64/MonetDB-ODBC-Installer.vdproj
        NT/installer64/MonetDB5-Geom-Module.vdproj
        NT/rules.msc
        clients/mapiclient/Makefile.ag
        clients/mapiclient/eventparser.c
        common/utils/Makefile.ag
        monetdb5/modules/atoms/mtime.c
        sql/test/mapi/Tests/perl_dbi.SQL.bat
        testing/Mtest.py.in
Branch: default
Log Message:

Merge


diffs (truncated from 774 to 300 lines):

diff --git a/NT/Makefile b/NT/Makefile
--- a/NT/Makefile
+++ b/NT/Makefile
@@ -24,7 +24,6 @@ install: targetdirs all
        $(INSTALL) .monetdb "$(sysconfdir)"
        $(INSTALL) ..\NT\installer$(bits)\*.sln "$(prefix)"
        $(INSTALL) ..\NT\installer$(bits)\*.vdproj "$(prefix)"
-       -if exist "C:\Program Files (x86)" if $(bits)==32 cd 
"$(prefix)"&&C:\cygwin\bin\sed.exe -i "s/Program Files/Program Files (x86)/" 
*.vdproj
 
 $(srcdir)\Makefile.msc: "$(srcdir)\Makefile.ag"
         cd "$(srcdir)"&&set PYTHONPATH=buildtools\autogen&&python 
buildtools\autogen\autogen.py
diff --git a/NT/installer32/MonetDB-ODBC-Installer.vdproj 
b/NT/installer32/MonetDB-ODBC-Installer.vdproj
--- a/NT/installer32/MonetDB-ODBC-Installer.vdproj
+++ b/NT/installer32/MonetDB-ODBC-Installer.vdproj
@@ -1207,7 +1207,7 @@
             {
             "UseDynamicProperties" = "11:TRUE"
             "IsDependency" = "11:FALSE"
-            "SourcePath" = "8:C:\\Program Files\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x86.msm"
+            "SourcePath" = "8:C:\\Program Files (x86)\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x86.msm"
                 "Properties"
                 {
                 }
diff --git a/NT/installer32/MonetDB5-Geom-Module.vdproj 
b/NT/installer32/MonetDB5-Geom-Module.vdproj
--- a/NT/installer32/MonetDB5-Geom-Module.vdproj
+++ b/NT/installer32/MonetDB5-Geom-Module.vdproj
@@ -999,7 +999,7 @@
             {
             "UseDynamicProperties" = "11:TRUE"
             "IsDependency" = "11:FALSE"
-            "SourcePath" = "8:C:\\Program Files\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x86.msm"
+            "SourcePath" = "8:C:\\Program Files (x86)\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x86.msm"
                 "Properties"
                 {
                 }
diff --git a/NT/installer32/MonetDB5-SQL-Installer.vdproj 
b/NT/installer32/MonetDB5-SQL-Installer.vdproj
--- a/NT/installer32/MonetDB5-SQL-Installer.vdproj
+++ b/NT/installer32/MonetDB5-SQL-Installer.vdproj
@@ -4927,7 +4927,7 @@
             {
             "UseDynamicProperties" = "11:TRUE"
             "IsDependency" = "11:FALSE"
-            "SourcePath" = "8:C:\\Program Files\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x86.msm"
+            "SourcePath" = "8:C:\\Program Files (x86)\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x86.msm"
                 "Properties"
                 {
                 }
diff --git a/NT/installer64/MonetDB-ODBC-Installer.vdproj 
b/NT/installer64/MonetDB-ODBC-Installer.vdproj
--- a/NT/installer64/MonetDB-ODBC-Installer.vdproj
+++ b/NT/installer64/MonetDB-ODBC-Installer.vdproj
@@ -1207,7 +1207,7 @@
             {
             "UseDynamicProperties" = "11:TRUE"
             "IsDependency" = "11:FALSE"
-            "SourcePath" = "8:C:\\Program Files\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x64.msm"
+            "SourcePath" = "8:C:\\Program Files (x86)\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x64.msm"
                 "Properties"
                 {
                 }
diff --git a/NT/installer64/MonetDB5-Geom-Module.vdproj 
b/NT/installer64/MonetDB5-Geom-Module.vdproj
--- a/NT/installer64/MonetDB5-Geom-Module.vdproj
+++ b/NT/installer64/MonetDB5-Geom-Module.vdproj
@@ -999,7 +999,7 @@
             {
             "UseDynamicProperties" = "11:TRUE"
             "IsDependency" = "11:FALSE"
-            "SourcePath" = "8:C:\\Program Files\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x64.msm"
+            "SourcePath" = "8:C:\\Program Files (x86)\\Common Files\\Merge 
Modules\\Microsoft_VC100_CRT_x64.msm"
                 "Properties"
                 {
                 }
diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -439,7 +439,7 @@ create_winconfig_conds_new_py:
 
 update_winconfig_conds_py: create_winconfig_conds_new_py
        if not exist "$(TOPDIR)\winconfig_conds.py" $(CP) 
"$(TOPDIR)\winconfig_conds_new.py" "$(TOPDIR)\winconfig_conds.py"
-       C:\cygwin\bin\cmp.exe -s "$(TOPDIR)\winconfig_conds_new.py" 
"$(TOPDIR)\winconfig_conds.py" || \
+       cmp -s "$(TOPDIR)\winconfig_conds_new.py" 
"$(TOPDIR)\winconfig_conds.py" || \
        $(CP) "$(TOPDIR)\winconfig_conds_new.py" "$(TOPDIR)\winconfig_conds.py"
 
 CONFIGURE=$(PYTHON) $(CONFIGURE_PY) \
diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag
--- a/clients/mapiclient/Makefile.ag
+++ b/clients/mapiclient/Makefile.ag
@@ -5,7 +5,7 @@
 # Copyright 2008-2015 MonetDB B.V.
 
 MTSAFE
-INCLUDES = ../mapilib ../../common/options ../../common/stream 
../R/MonetDB.R/src $(READLINE_INCS)
+INCLUDES = ../mapilib ../../common/options ../../common/stream 
../../common/utils ../R/MonetDB.R/src $(READLINE_INCS)
 
 lib_mcutil = {
        NOINST
diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c
--- a/clients/mapiclient/eventparser.c
+++ b/clients/mapiclient/eventparser.c
@@ -23,6 +23,11 @@ int malvartop;
 int debug=0;
 char *monetdb_characteristics;
 
+#ifndef HAVE_STRPTIME
+extern char *strptime(const char *, const char *, struct tm *);
+#include "strptime.c"
+#endif
+
 void
 clearArguments(void)
 {
@@ -205,7 +210,6 @@ parseArguments(char *call, int m)
 int
 eventparser(char *row, EventRecord *ev)
 {
-#ifdef HAVE_STRPTIME
        char *c, *cc, *v =0;
        struct tm stm;
 
@@ -427,8 +431,5 @@ eventparser(char *row, EventRecord *ev)
        }
        if (ev->stmt && (v=strstr(ev->stmt, ";\",\t")))
                *v = 0;
-#else
-       (void) row;
-#endif
        return 0;
 }
diff --git a/common/utils/Makefile.ag b/common/utils/Makefile.ag
--- a/common/utils/Makefile.ag
+++ b/common/utils/Makefile.ag
@@ -30,4 +30,4 @@ lib_msabaoth = {
        SOURCES = msabaoth.h msabaoth.c
 }
 
-EXTRA_DIST = s_nextafterf.c math_private.h
+EXTRA_DIST = s_nextafterf.c math_private.h strptime.c
diff --git a/common/utils/strptime.c b/common/utils/strptime.c
new file mode 100644
--- /dev/null
+++ b/common/utils/strptime.c
@@ -0,0 +1,445 @@
+/*
+ * Copyright (c) 1999 Kungliga Tekniska Högskolan
+ * (Royal Institute of Technology, Stockholm, Sweden). 
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ *
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright 
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the distribution. 
+ *
+ * 3. Neither the name of KTH nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY KTH AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KTH OR ITS CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
+
+#ifdef WIN32
+
+/* #include "platform/platform.h" */
+
+
+static const char *abb_weekdays[] = {
+    "Sun",
+    "Mon",
+    "Tue",
+    "Wed",
+    "Thu",
+    "Fri",
+    "Sat",
+    NULL
+};
+
+static const char *full_weekdays[] = {
+    "Sunday",
+    "Monday",
+    "Tuesday",
+    "Wednesday",
+    "Thursday",
+    "Friday",
+    "Saturday",
+    NULL
+};
+
+static const char *abb_month[] = {
+    "Jan",
+    "Feb",
+    "Mar",
+    "Apr",
+    "May",
+    "Jun",
+    "Jul",
+    "Aug",
+    "Sep",
+    "Oct",
+    "Nov",
+    "Dec",
+    NULL
+};
+
+static const char *full_month[] = {
+    "January",
+    "February",
+    "Mars",
+    "April",
+    "May",
+    "June",
+    "July",
+    "August",
+    "September",
+    "October",
+    "November",
+    "December",
+    NULL,
+};
+
+static const char *ampm[] = {
+    "am",
+    "pm",
+    NULL
+};
+
+/*
+ * Try to match `*buf' to one of the strings in `strs'.  Return the
+ * index of the matching string (or -1 if none).  Also advance buf.
+ */
+
+static int
+match_string (const char **buf, const char **strs)
+{
+    int i = 0;
+
+    for (i = 0; strs[i] != NULL; ++i) {
+       size_t len = strlen (strs[i]);
+
+       if (strncasecmp (*buf, strs[i], len) == 0) {
+           *buf += len;
+           return i;
+       }
+    }
+    return -1;
+}
+
+/*
+ * tm_year is relative this year */
+
+const int tm_year_base = 1900;
+
+/*
+ * Return TRUE iff `year' was a leap year.
+ */
+
+static int
+is_leap_year (int year)
+{
+    return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
+}
+
+/*
+ * Return the weekday [0,6] (0 = Sunday) of the first day of `year'
+ */
+
+static int
+first_day (int year)
+{
+    int ret = 4;
+
+    for (; year > 1970; --year)
+       ret = (ret + 365 + is_leap_year (year) ? 1 : 0) % 7;
+    return ret;
+}
+
+/*
+ * Set `timeptr' given `wnum' (week number [0, 53])
+ */
+
+static void
+set_week_number_sun (struct tm *timeptr, int wnum)
+{
+    int fday = first_day (timeptr->tm_year + tm_year_base);
+
+    timeptr->tm_yday = wnum * 7 + timeptr->tm_wday - fday;
+    if (timeptr->tm_yday < 0) {
+       timeptr->tm_wday = fday;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to