Changeset: 09833071fc6c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=09833071fc6c Modified Files: monetdb5/mal/mal_profiler.c monetdb5/modules/atoms/mtime.c 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 sql/test/pg_regress/Tests/load.SQL.sh Branch: default Log Message:
Merge with Oct2014 branch. diffs (123 lines): diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c --- a/monetdb5/mal/mal_profiler.c +++ b/monetdb5/mal/mal_profiler.c @@ -1091,7 +1091,7 @@ cachedProfilerEvent(int idx, MalBlkPtr m { /* static struct Mallinfo prevMalloc; */ char buf[1024]; - char ctm[27]={0}, *tbuf; + char ctm[27]={0}; int tid = (int)THRgettid(); char abuf[BUFSIZ], *tpe; int i, j; @@ -1141,15 +1141,19 @@ cachedProfilerEvent(int idx, MalBlkPtr m * argument of type "long *" is incompatible with parameter of type "const time_t={__time64_t={__int64}} *" */ #ifdef HAVE_CTIME_R3 - tbuf = ctime_r(&clk, ctm, sizeof(ctm)); + if (ctime_r(&clk, ctm, sizeof(ctm)) == NULL) + strncpy(ctm, "", sizeof(ctm)); #else #ifdef HAVE_CTIME_R - tbuf = ctime_r(&clk, ctm); + if (ctime_r(&clk, ctm) == NULL) + strncpy(ctm, "", sizeof(ctm)); #else - tbuf = ctime(&clk); + { + char *tbuf = ctime(&clk); + strncpy(ctm, tbuf ? tbuf : "", sizeof(ctm)); + } #endif #endif - strncpy(ctm, (tbuf?tbuf:""),26); /* sneakily overwrite year with second fraction */ snprintf(ctm + 19, 6, ".%03d", (int)(clock.tv_usec / 1000)); diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c --- a/monetdb5/modules/atoms/mtime.c +++ b/monetdb5/modules/atoms/mtime.c @@ -3462,6 +3462,6 @@ MTIMEstrftime(str *s, const date *d, con strncpy(*s, buf, sz + 1); return MAL_SUCCEED; #else - throw(MAL, "mtime.str_to_date", "strptime support missing"); + throw(MAL, "mtime.str_to_date", "strftime support missing"); #endif } diff --git a/sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.err.Windows b/sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.err.Windows --- a/sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.err.Windows +++ b/sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.err.Windows @@ -30,18 +30,12 @@ stderr of test 'date_script_test.Bug-297 # 14:12:34 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=rome" "--port=36122" # 14:12:34 > -MAPI = monetdb@LAB03:39057 +MAPI = monetdb@LAB03:34616 QUERY = select str_to_date('12-01-01','%y-%m-%d'); ERROR = !strptime support missing -MAPI = monetdb@LAB03:39057 +MAPI = monetdb@LAB03:34616 QUERY = select str_to_date('2012-01-01','%Y-%m-%d'); ERROR = !strptime support missing -MAPI = monetdb@LAB03:39057 -QUERY = select date_to_str('2012-02-11','%y/%m/%d'); -ERROR = !strptime support missing -MAPI = monetdb@LAB03:39057 -QUERY = select date_to_str('2012-02-11','%Y/%m/%d'); -ERROR = !strptime support missing # 14:12:34 > # 14:12:34 > "Done." diff --git a/sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.out.Windows b/sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.out.Windows --- a/sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.out.Windows +++ b/sql/test/BugTracker-2012/Tests/date_script_test.Bug-2973.stable.out.Windows @@ -19,12 +19,24 @@ stdout of test 'date_script_test.Bug-297 Ready. -# 14:12:34 > -# 14:12:34 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=rome" "--port=36122" -# 14:12:34 > +# 14:25:48 > +# 14:25:48 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=LAB03" "--port=34616" +# 14:25:48 > +#select date_to_str('2012-02-11','%y/%m/%d'); +% .L # table_name +% date_to_str_single_value # name +% clob # type +% 8 # length +[ "12/02/11" ] +#select date_to_str('2012-02-11','%Y/%m/%d'); +% .L # table_name +% date_to_str_single_value # name +% clob # type +% 10 # length +[ "2012/02/11" ] -# 14:12:34 > -# 14:12:34 > "Done." -# 14:12:34 > +# 14:25:49 > +# 14:25:49 > "Done." +# 14:25:49 > diff --git a/sql/test/pg_regress/Tests/load.SQL.sh b/sql/test/pg_regress/Tests/load.SQL.sh --- a/sql/test/pg_regress/Tests/load.SQL.sh +++ b/sql/test/pg_regress/Tests/load.SQL.sh @@ -6,11 +6,11 @@ Mlog "loading data with sed-foo" # don't load stud_emp, as it's the only data file with \N entries # (PostgreSQL NULL notation) -sed -r \ - -e s+@abs_srcdir@+$TSTSRCBASE/$TSTDIR+Ig \ +sed \ + -e "s+@abs_srcdir@+$TSTSRCBASE/$TSTDIR+g" \ -e '/@abs_builddir@/d' \ -e '/DELETE FROM/d' \ - -e "s/COPY (.*);/COPY INTO \1 USING DELIMITERS '\\\\t\', '\\\\n';/I" \ + -e "s/[Cc][Oo][Pp][Yy] \\(.*\\);/COPY INTO \\1 USING DELIMITERS '\\\\t', '\\\\n';/" \ -e '/stud_emp/d' \ $TSTSRCDIR/../input/copy.source \ | $SQL_CLIENT _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list