Changeset: 8dd6d7d9da8f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8dd6d7d9da8f
Added Files:
sql/backends/monet5/generator/90_generator_hge.mal
sql/backends/monet5/generator/90_generator_hge.sql
sql/test/pg_regress/Tests/int4.stable.out.int128
sql/test/pg_regress/Tests/int8.stable.err.int128
sql/test/pg_regress/Tests/int8.stable.out.int128
sql/test/pg_regress/Tests/strings.stable.err.int128
Removed Files:
sql/backends/monet5/generator/89_generator_hge.mal
sql/backends/monet5/generator/89_generator_hge.sql
sql/backends/monet5/vaults/Tests/All
Modified Files:
clients/R/MonetDB.R/src/mapisplit.c
clients/R/MonetDB.R/src/profiler.c
clients/Tests/MAL-signatures_all.stable.out
clients/Tests/MAL-signatures_all.stable.out.int128
clients/Tests/SQL-dump_all.stable.out.int128
clients/Tests/SQL-dump_all.stable.out.oid32.int128
clients/Tests/exports.stable.out
clients/mapiclient/Makefile.ag
clients/odbc/driver/ODBCConvert.c
clients/odbc/driver/ODBCDbc.h
clients/odbc/driver/ODBCDesc.h
clients/odbc/driver/ODBCError.c
clients/odbc/driver/ODBCStmt.h
clients/odbc/driver/ODBCUtil.c
clients/odbc/driver/SQLColAttribute.c
clients/odbc/driver/SQLColAttributes.c
clients/odbc/driver/SQLExecute.c
clients/odbc/driver/SQLFetch.c
clients/odbc/driver/SQLGetConnectAttr.c
clients/odbc/driver/SQLGetConnectOption.c
clients/odbc/driver/SQLGetDescField.c
clients/odbc/driver/SQLGetDiagField.c
clients/odbc/driver/SQLGetDiagRec.c
clients/odbc/driver/SQLGetInfo.c
clients/odbc/driver/SQLGetStmtAttr.c
clients/odbc/driver/SQLGetStmtOption.c
clients/odbc/driver/SQLSetConnectAttr.c
clients/odbc/driver/SQLSetDescField.c
clients/odbc/driver/SQLSetDescRec.c
clients/odbc/driver/SQLSetEnvAttr.c
clients/odbc/driver/SQLSetStmtAttr.c
gdk/gdk_logger.c
monetdb5/modules/atoms/mtime.c
monetdb5/modules/atoms/mtime.h
monetdb5/modules/atoms/mtime.mal
monetdb5/modules/mal/tablet.c
monetdb5/modules/mal/tablet.h
monetdb5/optimizer/opt_pushselect.c
monetdb5/optimizer/opt_support.c
sql/backends/monet5/generator/Makefile.ag
sql/backends/monet5/generator/Tests/generator01.stable.err
sql/backends/monet5/generator/Tests/generator02.stable.out
sql/backends/monet5/generator/Tests/generator04.stable.err
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql.mal
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_result.h
sql/backends/monet5/sql_upgrades.c
sql/benchmarks/tpch/Tests/06-explain.stable.out.int128
sql/benchmarks/tpch/Tests/14-explain.stable.out.int128
sql/benchmarks/tpch/Tests/17-explain.stable.out.int128
sql/benchmarks/tpch/Tests/19-explain.stable.out.int128
sql/common/sql_types.c
sql/common/sql_types.h
sql/rel.txt
sql/server/rel_dump.c
sql/server/rel_select.c
sql/server/rel_updates.c
sql/server/sql_atom.c
sql/server/sql_parser.y
sql/server/sql_scan.c
sql/test/BugDay_2005-11-09_2.9.3/Tests/date_functions.SF-967145.stable.out
sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.out
sql/test/BugTracker-2011/Tests/time_precision.Bug-2873.stable.out
sql/test/BugTracker-2012/Tests/now_results_in_illegal_argument.Bug-2978.stable.out
sql/test/BugTracker-2012/Tests/round-type-inference.Bug-2987.stable.out
sql/test/BugTracker-2012/Tests/timestamp-diff.Bug-3190.stable.out
sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out
sql/test/BugTracker-2014/Tests/too_general_errmsg.Bug-3605.stable.err
sql/test/BugTracker-2015/Tests/reserved_keywords.Bug-3613.sql
sql/test/BugTracker-2015/Tests/reserved_keywords.Bug-3613.stable.out
sql/test/VOC/Tests/median.Bug-3096.stable.out
sql/test/bugs/Tests/default_with_cast.SF-1334486.stable.out
sql/test/leaks/Tests/check1_bam.stable.out.int128
sql/test/leaks/Tests/check2_bam.stable.out.int128
sql/test/leaks/Tests/check3_bam.stable.out.int128
sql/test/leaks/Tests/check4_bam.stable.out.int128
sql/test/leaks/Tests/check5_bam.stable.out.int128
sql/test/pg_regress/Tests/All
sql/test/pg_regress/Tests/case.sql
sql/test/pg_regress/Tests/case.stable.err
sql/test/pg_regress/Tests/case.stable.out
sql/test/pg_regress/Tests/date.stable.err
sql/test/pg_regress/Tests/date.stable.out
sql/test/pg_regress/Tests/horology.stable.err
sql/test/pg_regress/Tests/horology.stable.out
sql/test/pg_regress/Tests/inet.stable.err
sql/test/pg_regress/Tests/int4.stable.out
sql/test/pg_regress/Tests/int8.stable.err
sql/test/pg_regress/Tests/int8.stable.out
sql/test/pg_regress/Tests/interval.stable.err
sql/test/pg_regress/Tests/interval.stable.out
sql/test/pg_regress/Tests/numeric.stable.err
sql/test/pg_regress/Tests/oid.sql
sql/test/pg_regress/Tests/oid.stable.err
sql/test/pg_regress/Tests/oid.stable.out
sql/test/pg_regress/Tests/strings.stable.err
sql/test/pg_regress/Tests/strings_cast.stable.err
sql/test/pg_regress/Tests/strings_cast.stable.out
sql/test/pg_regress/Tests/time.stable.err
sql/test/pg_regress/Tests/time.stable.out
sql/test/pg_regress/Tests/timestamp.stable.err
sql/test/pg_regress/Tests/timestamp.stable.out
sql/test/pg_regress/Tests/timestamptz.stable.err
sql/test/pg_regress/Tests/timestamptz.stable.out
sql/test/pg_regress/Tests/timetz.stable.err
sql/test/pg_regress/Tests/timetz.stable.out
sql/test/pg_regress/Tests/varchar.sql
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:
Merge with default
diffs (truncated from 16461 to 300 lines):
diff --git a/clients/R/MonetDB.R/src/mapisplit.c
b/clients/R/MonetDB.R/src/mapisplit.c
--- a/clients/R/MonetDB.R/src/mapisplit.c
+++ b/clients/R/MonetDB.R/src/mapisplit.c
@@ -28,7 +28,7 @@ void mapi_line_split(char* line, char**
int endQuote = 0;
int curPos;
- int linelen = strlen(line);
+ int linelen = (int) strlen(line);
mapi_line_chrstate state = INCRAP;
for (curPos = 2; curPos < linelen - 1; curPos++) {
diff --git a/clients/R/MonetDB.R/src/profiler.c
b/clients/R/MonetDB.R/src/profiler.c
--- a/clients/R/MonetDB.R/src/profiler.c
+++ b/clients/R/MonetDB.R/src/profiler.c
@@ -4,23 +4,33 @@
#include <errno.h>
#include <stdio.h>
+#ifndef _MSC_VER
#include <pthread.h>
+#endif
#include <signal.h>
#include <unistd.h>
#include <math.h>
#include <stdlib.h>
#include <sys/types.h>
+#ifdef _MSC_VER
+#include <sys/timeb.h>
+typedef int ssize_t;
+#else
#include <sys/fcntl.h>
#include <sys/time.h>
+#endif
-#ifdef __WIN32__
+#if defined(_MSC_VER) || defined(__WIN32__)
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#define HAVE_NL_LANGINFO /* not on Windows, probably everywhere else */
+typedef int SOCKET;
+#define INVALID_SOCKET (-1)
+#define SOCKET_ERROR (-1)
#endif
#ifdef HAVE_NL_LANGINFO
@@ -40,8 +50,12 @@
// size of the progress bar in characters
#define PROFILER_BARSYMB 60
-static int profiler_socket;
+static SOCKET profiler_socket;
+#ifdef _MSC_VER
+static HANDLE profiler_pthread;
+#else
static pthread_t profiler_pthread;
+#endif
static int profiler_needcleanup = 0;
static int profiler_armed = 0;
@@ -56,7 +70,7 @@ void mal_statement_split(char* stmt, mal
while (str[0] == ' ' || str[0] == '"') str++; endPos = curPos - 1; \
while (stmt[endPos] == ' ' || stmt[endPos] == '"') { stmt[endPos] =
'\0'; endPos--; }
- unsigned int curPos, endPos, paramStart = 0, stmtLen;
+ size_t curPos, endPos, paramStart = 0, stmtLen;
mal_statement_state state = ASSIGNMENT;
out->assignment = stmt;
@@ -120,12 +134,18 @@ void mal_statement_split(char* stmt, mal
}
static unsigned long profiler_tsms(void) {
+#ifdef _MSC_VER
+ struct _timeb tb;
+ _ftime_s(&tb);
+ return (unsigned long) tb.time * 1000 + (unsigned long) tb.millitm;
+#else
unsigned long ret = 0;
struct timeval tv;
gettimeofday(&tv, NULL);
ret += tv.tv_sec * 1000;
ret += tv.tv_usec / 1000;
return ret;
+#endif
}
// clear line and overwrite with spaces
@@ -145,16 +165,21 @@ void profiler_renderbar(size_t state, si
percentage = (unsigned short) ceil((1.0 *
state / total) * 100);
- symbols = PROFILER_BARSYMB*(percentage/100.0);
+ symbols = (unsigned short) (PROFILER_BARSYMB*(percentage/100.0));
printf("%s ", symbol);
for (bs=0; bs < symbols; bs++) printf("%s", profiler_symb_bfull);
for (bs=0; bs < PROFILER_BARSYMB-symbols; bs++) printf("%s",
profiler_symb_bfree);
- printf(" %3u%% ", percentage);
+ printf(" %3u%% ", (unsigned int) percentage);
fflush(NULL);
}
-static void* profiler_thread(void* params) {
+#ifdef _MSC_VER
+static DWORD WINAPI profiler_thread(LPVOID params)
+#else
+static void* profiler_thread(void* params)
+#endif
+{
char buf[BUFSIZ];
char* elems[TRACE_NCOLS];
// query ids are unlikely to be longer than BUFSIZ
@@ -173,9 +198,9 @@ static void* profiler_thread(void* param
(void) params;
for(;;) {
- recvd = read(profiler_socket, buf, sizeof(buf));
- if (recvd < 0)
- return NULL;
+ recvd = recv(profiler_socket, buf, sizeof(buf), 0);
+ if (recvd == SOCKET_ERROR)
+ return 0;
if (recvd > 0) {
size_t i = 0, j = 0;
char ib = 0;
@@ -200,8 +225,12 @@ static void* profiler_thread(void* param
if (profiler_armed && strcmp(stmt->function,
"querylog.define") == 0) {
// the third parameter to querylog.define
contains the MAL plan size
- profiler_msgs_expect = atol(stmt->params[2]) -
2;
+ profiler_msgs_expect = atol(stmt->params[2]) -
3;
+#ifdef _MSC_VER
+ strcpy_s(queryid, BUFSIZ, thisqueryid);
+#else
strcpy(queryid, thisqueryid);
+#endif
profiler_querystart = profiler_tsms();
profiler_msgs_done = 0;
profiler_needcleanup = 0;
@@ -215,13 +244,13 @@ static void* profiler_thread(void* param
profiler_msgs_done++;
- if (profiler_msgs_expect > 0 && (profiler_tsms() -
profiler_querystart) > 500) {
- profiler_renderbar(profiler_msgs_done,
profiler_msgs_expect, profiler_symb_query);
- }
- if (profiler_msgs_done >= profiler_msgs_expect) {
- profiler_clearbar();
- profiler_msgs_expect = 0;
- }
+ if (profiler_msgs_expect > 0 && (profiler_tsms() -
profiler_querystart) > 500) {
+ profiler_renderbar(profiler_msgs_done,
profiler_msgs_expect, profiler_symb_query);
+ }
+ if (profiler_msgs_done >= profiler_msgs_expect) {
+ profiler_clearbar();
+ profiler_msgs_expect = 0;
+ }
}
}
}
@@ -239,8 +268,8 @@ int profiler_start(void) {
socklen_t len = sizeof(serv_addr);
profiler_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
- if(profiler_socket < 0) {
- return -1;
+ if(profiler_socket == INVALID_SOCKET) {
+ return -1;
}
memset((char *) &serv_addr, 0, sizeof(serv_addr));
@@ -248,9 +277,9 @@ int profiler_start(void) {
serv_addr.sin_addr.s_addr = INADDR_ANY;
serv_addr.sin_port = 0; // automatically find free port
- if (bind(profiler_socket, (struct sockaddr *) &serv_addr,
sizeof(serv_addr)) < 0 ||
- getsockname(profiler_socket, (struct sockaddr *)&serv_addr,
&len) < 0) {
- return -1;
+ if (bind(profiler_socket, (struct sockaddr *) &serv_addr,
sizeof(serv_addr)) == SOCKET_ERROR ||
+ getsockname(profiler_socket, (struct sockaddr *)&serv_addr, &len)
== SOCKET_ERROR) {
+ return -1;
}
#ifdef HAVE_NL_LANGINFO
@@ -263,6 +292,10 @@ int profiler_start(void) {
#endif
// start backgroud listening thread
+#ifdef _MSC_VER
+ profiler_pthread = CreateThread(NULL, 1024*1024, profiler_thread, NULL,
0, NULL);
+#else
pthread_create(&profiler_pthread, NULL, &profiler_thread, NULL);
+#endif
return ntohs(serv_addr.sin_port);
}
diff --git a/clients/Tests/MAL-signatures_all.stable.out
b/clients/Tests/MAL-signatures_all.stable.out
--- a/clients/Tests/MAL-signatures_all.stable.out
+++ b/clients/Tests/MAL-signatures_all.stable.out
@@ -37888,6 +37888,10 @@ pattern fits.listdir(dirname:str):void
address FITSdir;
comment Attach all FITS files in the directory
+pattern generator.join(b:bat[:oid,:hge],gen:bat[:oid,:hge])
(l:bat[:oid,:oid],r:bat[:oid,:oid])
+address VLTgenerator_join;
+comment Overloaded join operation
+
pattern
generator.join(gen:bat[:oid,:dbl],low:bat[:oid,:dbl],hgh:bat[:oid,:dbl],li:bit,ri:bit)
(l:bat[:oid,:oid],r:bat[:oid,:oid])
address VLTgenerator_rangejoin;
comment Overloaded range join operation
@@ -39562,6 +39566,10 @@ command mtime.date_add_month_interval(t:
address MTIMEdate_addmonths;
comment Add months to a date
+command mtime.diff(val1:daytime,val2:daytime):lng
+address MTIMEdaytime_diff;
+comment returns the number of msec between 'val1' and 'val2'.
+
command mtime.date_add_msec_interval(t:date,ms:lng):date
address MTIMEdate_add_msec_interval_lng_wrap;
command mtime.date_add_sec_interval(t:date,s:int):date
diff --git a/clients/Tests/MAL-signatures_all.stable.out.int128
b/clients/Tests/MAL-signatures_all.stable.out.int128
--- a/clients/Tests/MAL-signatures_all.stable.out.int128
+++ b/clients/Tests/MAL-signatures_all.stable.out.int128
@@ -48771,6 +48771,10 @@ pattern fits.listdir(dirname:str):void
address FITSdir;
comment Attach all FITS files in the directory
+pattern generator.join(b:bat[:oid,:hge],gen:bat[:oid,:hge])
(l:bat[:oid,:oid],r:bat[:oid,:oid])
+address VLTgenerator_join;
+comment Overloaded join operation
+
pattern
generator.join(gen:bat[:oid,:dbl],low:bat[:oid,:dbl],hgh:bat[:oid,:dbl],li:bit,ri:bit)
(l:bat[:oid,:oid],r:bat[:oid,:oid])
address VLTgenerator_rangejoin;
comment Overloaded range join operation
@@ -48799,9 +48803,9 @@ pattern generator.join(b:bat[:oid,:sht],
address VLTgenerator_join;
pattern generator.join(b:bat[:oid,:bte],gen:bat[:oid,:bte])
(l:bat[:oid,:oid],r:bat[:oid,:oid])
address VLTgenerator_join;
-pattern generator.join(b:bat[:oid,:hge],gen:bat[:oid,:hge])
(l:bat[:oid,:oid],r:bat[:oid,:oid])
-address VLTgenerator_join;
-comment Overloaded join operation
+pattern
generator.leftfetchjoin(b:bat[:oid,:oid],cand:bat[:oid,:hge]):bat[:oid,:hge]
+address VLTgenerator_leftfetchjoin;
+comment Overloaded leftfetchjoin operation
pattern
generator.leftfetchjoin(b:bat[:oid,:oid],cand:bat[:oid,:timestamp]):bat[:oid,:timestamp]
address VLTgenerator_leftfetchjoin;
@@ -48819,9 +48823,11 @@ pattern generator.leftfetchjoin(b:bat[:o
address VLTgenerator_leftfetchjoin;
pattern
generator.leftfetchjoin(b:bat[:oid,:oid],cand:bat[:oid,:bte]):bat[:oid,:bte]
address VLTgenerator_leftfetchjoin;
-pattern
generator.leftfetchjoin(b:bat[:oid,:oid],cand:bat[:oid,:hge]):bat[:oid,:hge]
-address VLTgenerator_leftfetchjoin;
-comment Overloaded leftfetchjoin operation
+pattern generator.parameters(first:hge,last:hge):bat[:oid,:hge]
+address VLTgenerator_noop;
+pattern generator.parameters(first:hge,last:hge,step:hge):bat[:oid,:hge]
+address VLTgenerator_noop;
+comment Retain the table definition, but don't materialize
pattern generator.parameters(first:dbl,last:dbl):bat[:oid,:dbl]
address VLTgenerator_noop;
@@ -48851,12 +48857,20 @@ pattern generator.parameters(first:sht,l
address VLTgenerator_noop;
pattern generator.parameters(first:bte,last:bte,step:bte):bat[:oid,:bte]
address VLTgenerator_noop;
-pattern generator.parameters(first:hge,last:hge):bat[:oid,:hge]
-address VLTgenerator_noop;
-pattern generator.parameters(first:hge,last:hge,step:hge):bat[:oid,:hge]
-address VLTgenerator_noop;
-comment Retain the table definition, but don't materialize
-
+pattern
generator.subselect(b:bat[:oid,:hge],cand:bat[:oid,:oid],low:hge,high:hge,li:bit,hi:bit,anti:bit):bat[:oid,:oid]
+address VLTgenerator_subselect;
+comment Overloaded selection routine
+
+pattern
generator.subselect(b:bat[:oid,:hge],low:hge,high:hge,li:bit,hi:bit,anti:bit):bat[:oid,:oid]
+address VLTgenerator_subselect;
+comment Overloaded selection routine
+
+pattern generator.series(first:hge,last:hge,step:hge):bat[:oid,:hge]
+address VLTgenerator_table;
+comment Create and materialize a generator table
+
+pattern generator.series(first:hge,last:hge):bat[:oid,:hge]
+address VLTgenerator_table;
pattern
generator.subselect(b:bat[:oid,:timestamp],cand:bat[:oid,:oid],low:timestamp,high:timestamp,li:bit,hi:bit,anti:bit):bat[:oid,:oid]
address VLTgenerator_subselect;
comment Overloaded selection routine
@@ -48917,20 +48931,14 @@ pattern generator.series(first:sht,last:
address VLTgenerator_table;
pattern generator.series(first:bte,last:bte):bat[:oid,:bte]
address VLTgenerator_table;
-pattern
generator.subselect(b:bat[:oid,:hge],cand:bat[:oid,:oid],low:hge,high:hge,li:bit,hi:bit,anti:bit):bat[:oid,:oid]
-address VLTgenerator_subselect;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list