Changeset: 559d1102cb5a for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/559d1102cb5a Modified Files: monetdb5/optimizer/opt_mergetable.c sql/backends/monet5/mal_backend.h sql/backends/monet5/sql.c sql/backends/monet5/sql.h sql/backends/monet5/sql_gencode.c sql/backends/monet5/sql_gencode.h sql/server/rel_optimizer.c Branch: pushcands Log Message:
merged with default diffs (truncated from 2450 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -523,7 +523,6 @@ exit 0 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5/dbfarm %{_bindir}/mserver5 -%exclude %{_bindir}/stethoscope %{_libdir}/libmonetdb5.so.* %{_libdir}/libmonetdbsql.so* %dir %{_libdir}/monetdb5 diff --git a/clients/NT/stethoscope.bat b/clients/NT/stethoscope.bat deleted file mode 100755 --- a/clients/NT/stethoscope.bat +++ /dev/null @@ -1,20 +0,0 @@ -@REM This Source Code Form is subject to the terms of the Mozilla Public -@REM License, v. 2.0. If a copy of the MPL was not distributed with this -@REM file, You can obtain one at http://mozilla.org/MPL/2.0/. -@REM -@REM Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V. - -@echo off -rem figure out the folder name -set MONETDB=%~dp0 - -rem remove the final backslash from the path -set MONETDB=%MONETDB:~0,-1% - -rem extend the search path with our EXE and DLL folders -set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH% - -rem start the real client -"%MONETDB%\bin\stethoscope.exe" %1 %2 %3 %4 %5 %6 %7 %8 - -if ERRORLEVEL 1 pause diff --git a/clients/mapiclient/CMakeLists.txt b/clients/mapiclient/CMakeLists.txt --- a/clients/mapiclient/CMakeLists.txt +++ b/clients/mapiclient/CMakeLists.txt @@ -75,29 +75,6 @@ target_link_libraries(msqldump mprompt $<$<PLATFORM_ID:Windows>:${GETOPT_LIB}>) -add_executable(stethoscope) - -target_sources(stethoscope - PRIVATE - stethoscope.c - eventparser.c - eventparser.h) - -target_include_directories(stethoscope - PRIVATE - $<$<PLATFORM_ID:Windows>:${HAVE_GETOPT_H}>) - -target_link_libraries(stethoscope - PRIVATE - monetdb_config_header - mcutil - stream - mapi - mprompt - mutils - $<$<PLATFORM_ID:Windows>:${GETOPT_LIB}> - $<$<PLATFORM_ID:Windows>:ws2_32>) - install(TARGETS mclient msqldump @@ -112,19 +89,6 @@ install(TARGETS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monetdb INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -install(TARGETS - stethoscope - RUNTIME - DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT tools - LIBRARY - DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE - DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monetdb - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - install(FILES mclient.1 msqldump.1 diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c deleted file mode 100644 --- a/clients/mapiclient/eventparser.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V. - */ - -/* (c) M Kersten */ - -#include "monetdb_config.h" -#include "eventparser.h" - -int debug=0; - -#define DATETIME_CHAR_LENGTH 27 - -#define FREE(X) if(X){ free(X); X= 0;} - -static void -resetEventRecord(EventRecord *ev) -{ int i; - - FREE(ev->version); - - // event state - FREE(ev->version); - FREE(ev->user); - FREE(ev->session); - FREE(ev->function); - FREE(ev->module); - FREE(ev->instruction); - FREE(ev->state); - FREE(ev->stmt); - FREE(ev->time); - for(i=0; i< ev->maxarg; i++){ - FREE(ev->args[i].alias); - FREE(ev->args[i].name); - FREE(ev->args[i].type); - FREE(ev->args[i].view); - FREE(ev->args[i].parent); - FREE(ev->args[i].persistence); - FREE(ev->args[i].file); - FREE(ev->args[i].seqbase); - FREE(ev->args[i].sorted); - FREE(ev->args[i].revsorted); - FREE(ev->args[i].nonil); - FREE(ev->args[i].nil); - FREE(ev->args[i].key); - FREE(ev->args[i].unique); - FREE(ev->args[i].value); - FREE(ev->args[i].debug); - } - ev->maxarg = 0; -} - -/* simple json key:value object parser for event record. - * It is a restricted json parser, which uses the knowledge of the mal profiler. - * Returns 1 if the closing bracket is found. 0 to continue, -1 upon error - */ - -#define skipto(H,C) { while(*H && *H != C) H++;} -#define skipstr() { while (*c && *c !='"') {if (*c =='\\') c++;if(*c)c++;} } - -/* - * Also parse the argument array structure - */ - -static char * -getstr(char *val){ - val[strlen(val) -1] = 0; - return strdup(val + 1); -} - -static int -argparser(char *txt, EventRecord *ev){ - char *c = NULL, *key = NULL,*val=NULL; - int cnt = 0, arg = -1; - c = txt; - - (void) ev; - (void) key; - /* First determine the number arguments to deal with */ - while(*c){ - skipto(c, '\t'); - if(*c){ - c++; - if(*c == '}') - cnt ++; - } - } - - /* Allocate the space for their properties */ - if(ev->args) free(ev->args); - ev->args = (Argrecord*) malloc(cnt * sizeof(Argrecord)); - memset(ev->args, 0, cnt * sizeof(Argrecord)); - ev->maxarg = cnt; - - /* parse the event argument structures, using the \t field separator */ - c= txt + 1; - while(*c){ - if(*c == '{' || *c == '[') - c++; - if(*c == '}' || *c == ']') - break; - - skipto(c, '"'); - key = ++c; - skipstr(); - *c++ = 0; - skipto(c, ':'); - c++; - val = c; - /* we know that the value is terminated with a hard tab */ - skipto(c, '\t'); - if(*c){ --c; *c = 0; c++;} - - /* These components should be the first */ - if(strstr(key,"ret")) { - arg = atoi(val); - ev->args[arg].kind = MDB_RET; - continue; - } - if(strstr(key,"arg")) { - arg = atoi(val); - ev->args[arg].kind = MDB_ARG; - continue; - } - assert(arg> -1 && arg < ev->maxarg); - if(strstr(key,"bid")) { ev->args[arg].bid = atoi(val); continue;} - if(strstr(key,"alias")) { ev->args[arg].alias = getstr(val); continue;} - if(strstr(key,"name")) { ev->args[arg].name = getstr(val); continue;} - if(strstr(key,"type")) { ev->args[arg].type = getstr(val);continue;} - if(strstr(key,"view")) { ev->args[arg].view = getstr(val); continue;} - if(strstr(key,"parent")) { ev->args[arg].parent = getstr(val); continue;} - if(strstr(key,"persistence")) { ev->args[arg].persistence = getstr(val); continue;} - if(strstr(key,"file")) { ev->args[arg].file = getstr(val); continue;} - if(strstr(key,"seqbase")) { ev->args[arg].seqbase = getstr(val); continue;} - if(strstr(key,"sorted")) { ev->args[arg].sorted = getstr(val); continue;} - if(strstr(key,"revsorted")) { ev->args[arg].revsorted = getstr(val); continue;} - if(strstr(key,"nonil")) { ev->args[arg].nonil = getstr(val); continue;} - if(strstr(key,"nil")) { ev->args[arg].nil = getstr(val); continue;} - if(strstr(key,"key")) { ev->args[arg].key = getstr(val); continue;} - if(strstr(key,"unique")) { ev->args[arg].unique = getstr(val); continue;} - if(strstr(key,"count")) { ev->args[arg].count = atol(val); continue;} - if(strstr(key,"size")) { ev->args[arg].size = getstr(val); continue;} - if(strstr(key,"value")) { ev->args[arg].value = getstr(val); continue;} - if(strstr(key,"debug")) { ev->args[arg].debug = getstr(val); continue;} - if(strstr(key,"const")) { ev->args[arg].constant = atoi(val); continue;} - } - return 1; -} - -int -keyvalueparser(char *txt, EventRecord *ev) -{ - char *c, *key, *val; - c = txt; - - if(*c == '{'){ - resetEventRecord(ev); - return 0; - } - if(*c == '}') - return 1; - - skipto(c, '"'); - key = ++c; - skipstr(); - *c++ = 0; - skipto(c, ':'); - c++; - while(*c && isspace((unsigned char) *c)) c++; - if(*c == '"'){ - val = ++c; - skipstr(); - *c = 0; - } else val =c; - - if(strstr(key,"mclk")){ - ev->usec = atol(val); - return 0; - } - if(strstr(key,"clk")){ - time_t sec; - uint64_t microsec; - struct tm curr_time = (struct tm) {0}; - - c = strchr(val,'.'); - if (c != NULL) { - *c = '\0'; - c++; - } - - sec = atol(val); - microsec = sec % 1000000; - sec /= 1000000; -#ifdef HAVE_LOCALTIME_R - (void)localtime_r(&sec, &curr_time); -#else - curr_time = *localtime(&sec); -#endif - ev->time = malloc(DATETIME_CHAR_LENGTH*sizeof(char)); - snprintf(ev->time, DATETIME_CHAR_LENGTH, "%d/%02d/%02d %02d:%02d:%02d.%"PRIu64, - curr_time.tm_year + 1900, curr_time.tm_mon, curr_time.tm_mday, - curr_time.tm_hour, curr_time.tm_min, curr_time.tm_sec, microsec); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list