Changeset: d3f02ee9a5cd for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d3f02ee9a5cd Added Files: sql/test/BugTracker-2018/Tests/ilike-foreign-characters.Bug-6633.sql sql/test/BugTracker-2018/Tests/ilike-foreign-characters.Bug-6633.stable.err sql/test/BugTracker-2018/Tests/ilike-foreign-characters.Bug-6633.stable.out Modified Files: clients/ChangeLog.Aug2018 clients/mapiclient/stethoscope.c clients/mapiclient/tachograph.c clients/mapiclient/tomograph.c clients/odbc/driver/SQLGetInfo.c configure.ag monetdb5/modules/mal/pcre.c sql/test/BugTracker-2018/Tests/All tools/merovingian/daemon/client.c Branch: default Log Message:
Merge with Aug2018 branch. diffs (truncated from 1196 to 300 lines): diff --git a/clients/ChangeLog.Aug2018 b/clients/ChangeLog.Aug2018 --- a/clients/ChangeLog.Aug2018 +++ b/clients/ChangeLog.Aug2018 @@ -1,6 +1,13 @@ # ChangeLog file for clients # This file is updated with Maddlog +* Thu Aug 2 2018 Martin van Dinther <martin.van.dint...@monetdbsolutions.com> +- ODBC SQLGetInfo now returns a positive numeric value for InfoTypes: + SQL_MAX_COLUMN_NAME_LEN, SQL_MAX_DRIVER_CONNECTIONS, + SQL_MAX_IDENTIFIER_LEN, SQL_MAX_PROCEDURE_NAME_LEN, + SQL_MAX_SCHEMA_NAME_LEN, SQL_MAX_TABLE_NAME_LEN and + SQL_MAX_USER_NAME_LEN. + * Fri May 25 2018 Ying Zhang <y.zh...@cwi.nl> - Added a '-f rowcount' option in mclient to repress printing the actual data of a resultset, but only print the number of returned tuples diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c --- a/clients/mapiclient/stethoscope.c +++ b/clients/mapiclient/stethoscope.c @@ -84,7 +84,7 @@ static FILE *trace = NULL; static void renderEvent(EventRecord *ev){ FILE *s; - if(trace != NULL) + if(trace != NULL) s = trace; else s = stdout; @@ -94,7 +94,7 @@ renderEvent(EventRecord *ev){ fprintf(s, "0, "); fprintf(s, "\"\", " ); fprintf(s, "0, "); - fprintf(s, "\"system\", "); + fprintf(s, "\"system\", "); fprintf(s, "0, "); fprintf(s, "0, "); fprintf(s, "0, "); @@ -102,7 +102,7 @@ renderEvent(EventRecord *ev){ fprintf(s, "0, "); fprintf(s, "0, "); fprintf(s, "\""); - fprintf(s, "version:%s, release:%s, threads:%s, memory:%s, host:%s, oid:%d, package:%s ", + fprintf(s, "version:%s, release:%s, threads:%s, memory:%s, host:%s, oid:%d, package:%s ", ev->version, ev->release, ev->threads, ev->memory, ev->host, ev->oid, ev->package); fprintf(s, "\" ]\n"); return ; @@ -122,7 +122,7 @@ renderEvent(EventRecord *ev){ case MDB_DONE: fprintf(s, "\"done \", "); break; case MDB_WAIT: fprintf(s, "\"wait \", "); break; case MDB_PING: fprintf(s, "\"ping \", "); break; - case MDB_SYSTEM: fprintf(s, "\"system\", "); + case MDB_SYSTEM: fprintf(s, "\"system\", "); } fprintf(s, "%"PRId64", ", ev->ticks); fprintf(s, "%"PRId64", ", ev->rss); @@ -494,7 +494,7 @@ main(int argc, char **argv) if (debug) printf("LASTLINE:%s", response); len = strlen(response); - strncpy(buffer, response, len + 1); + snprintf(buffer, len + 1, "%s", response); } else /* reset this line of buffer */ len = 0; } diff --git a/clients/mapiclient/tachograph.c b/clients/mapiclient/tachograph.c --- a/clients/mapiclient/tachograph.c +++ b/clients/mapiclient/tachograph.c @@ -8,7 +8,7 @@ /* author: M Kersten * Progress indicator - * tachograph -d demo + * tachograph -d demo * which connects to the demo database server and presents a server progress bar. */ @@ -133,7 +133,7 @@ int64_t finishtime = 0; int64_t duration =0; char *prevquery= 0; int prevprogress =0;// pc of previous progress display -int prevlevel =0; +int prevlevel =0; size_t txtlength=0; // limit the number of separate queries in the pool @@ -146,7 +146,7 @@ static void resetTachograph(void){ if (debug) fprintf(stderr, "RESET tachograph\n"); if( prevprogress) - printf("\n"); + printf("\n"); for(i=0; i < maxevents; i++) if( events[i].stmt) free(events[i].stmt); @@ -187,9 +187,9 @@ rendertime(int64_t ticks, int flg) min = (t /60) %60; hr = (t /3600); if( flg) - snprintf(stamp,BUFSIZ,"%02d:%02d:%02d.%06d", hr,min,sec, (int) ticks %1000000); + snprintf(stamp,BUFSIZ,"%02d:%02d:%02d.%06d", hr,min,sec, (int) ticks %1000000); else - snprintf(stamp,BUFSIZ,"%02d:%02d:%02d", hr,min,sec); + snprintf(stamp,BUFSIZ,"%02d:%02d:%02d", hr,min,sec); } #define MSGLEN 100 @@ -230,7 +230,7 @@ showBar(int level, int64_t clk, char *st rendertime(clk - duration ,0); printf(" +%s ETC ",stamp); stamplen= strlen(stamp)+3; - } + } if( stmt) printf("%s",stmt); fflush(stdout); @@ -249,7 +249,7 @@ update(EventRecord *ev) int progress=0; int i; int uid = 0,qid = 0; - + /* handle a ping event, keep the current instruction in focus */ if (ev->state >= MDB_PING ) { // All state events are ignored @@ -373,7 +373,7 @@ update(EventRecord *ev) fprintf(stderr, "Leave function %s capture %d\n", currentfunction, capturing); resetTachograph(); initFiles(); - } + } } } @@ -561,7 +561,7 @@ main(int argc, char **argv) if (debug) printf("LASTLINE:%s", response); len = strlen(response); - strncpy(buffer, response, len + 1); + snprintf(buffer, len + 1, "%s", response); } else /* reset this line of buffer */ len = 0; } diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c --- a/clients/mapiclient/tomograph.c +++ b/clients/mapiclient/tomograph.c @@ -491,7 +491,7 @@ stop_disconnect: if ( plen >= BSIZE-1){ error = -1; break; - } + } } @@ -500,7 +500,7 @@ stop_disconnect: fprintf(stderr,"-- exec:%s\n",buf); error = system(buf); } - if( error == 0) + if( error == 0) fprintf(stderr,"-- done: %s.pdf\n", basefile); else fprintf(stderr, "gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=%s.pdf -dBATCH %s\n", basefile, pages); @@ -581,7 +581,7 @@ static void resetTomograph(void){ } memset((char*) box, 0, sizeof(Box) * maxbox); - totalclkticks = 0; + totalclkticks = 0; totalexecticks = 0; lastclktick = 0; figures = 0; @@ -1141,7 +1141,7 @@ updatecolormap(int idx) fnd = i; colors[fnd].mod = strdup(mod); colors[fnd].fcn = strdup(fcn); - if( debug) + if( debug) fprintf(stderr,"-- Added function #%d: %s.%s\n", fnd, mod, fcn); } @@ -1353,7 +1353,7 @@ updateNumaHeatmap(int thread, char *numa /* the main issue to deal with in the analysis is * that the tomograph start can appear while the - * system is already processing. + * system is already processing. * receiving 'done' events without matching 'start' * * A secondary issue is to properly count the functions @@ -1368,14 +1368,14 @@ update(char *line, EventRecord *ev) int idx, i; Box b; int uid = 0,qid = 0; - + if (topbox == maxbox || maxbox < topbox) { if( box == 0){ - box = (Box*) malloc(MAXBOX * sizeof(Box)); + box = (Box*) malloc(MAXBOX * sizeof(Box)); memset((char*) box, 0, sizeof(Box) * MAXBOX); } else - box = (Box*) realloc((void*)box, (maxbox + MAXBOX) * sizeof(Box)); + box = (Box*) realloc((void*)box, (maxbox + MAXBOX) * sizeof(Box)); if( box == NULL){ fprintf(stderr, "Out of space for trace, exceeds max entries %d\n", maxbox); fprintf(stderr, "Restart with a slower beat might help, e.g. --beat=5000 or --beat=0\n"); @@ -1520,7 +1520,7 @@ update(char *line, EventRecord *ev) capturing--; if(debug) fprintf(stderr, "Leave function %s capture %d\n", currentfunction, capturing); - } + } if( capturing == 0){ if( tracefd){ fflush(tracefd); @@ -1682,7 +1682,7 @@ main(int argc, char **argv) prefix = strdup(prefix); *(s+1) = 0; prefix += s-dirpath; - } + } break; case 'r': { @@ -1691,7 +1691,7 @@ main(int argc, char **argv) break; if( *optarg == '=') optarg++; - cnt = sscanf(optarg,"%"PRId64"-%"PRId64, &startrange,&endrange); + cnt = sscanf(optarg,"%"PRId64"-%"PRId64, &startrange,&endrange); if( cnt != 2) usageTomograph(); @@ -1701,7 +1701,7 @@ main(int argc, char **argv) } else if( strchr(optarg,'s')){ startrange *= 1000000; endrange *= 1000000; - } else + } else usageTomograph(); if( debug ) fprintf(stderr,"Cut out slice %"PRId64" -%"PRId64"\n",startrange,endrange); @@ -1792,7 +1792,7 @@ main(int argc, char **argv) if (debug) fprintf(stderr,"LASTLINE:%s", response); len = strlen(response); - strncpy(buf, response, len + 1); + snprintf(buf, len + 1, "%s", response); } else len = 0; } @@ -1882,13 +1882,13 @@ main(int argc, char **argv) if (debug) fprintf(stderr,"LASTLINE:%s", response); len = strlen(response); - strncpy(buffer, response, len + 1); + snprintf(buffer, len + 1, "%s", response); } else /* reset this line of buffer */ len = 0; } } - if( !inputfile) + if( !inputfile) doQ("profiler.stop();"); stop_disconnect: if( !inputfile) { diff --git a/clients/odbc/driver/SQLGetInfo.c b/clients/odbc/driver/SQLGetInfo.c --- a/clients/odbc/driver/SQLGetInfo.c +++ b/clients/odbc/driver/SQLGetInfo.c @@ -700,6 +700,9 @@ MNDBGetInfo(ODBCDbc *dbc, case SQL_MAX_CHAR_LITERAL_LEN: break; case SQL_MAX_COLUMN_NAME_LEN: + nValue = 1024; /* max length of column sys._columns.name is defined as 1024 */ + len = sizeof(SQLUSMALLINT); + break; case SQL_MAX_COLUMNS_IN_GROUP_BY: case SQL_MAX_COLUMNS_IN_INDEX: case SQL_MAX_COLUMNS_IN_ORDER_BY: @@ -707,10 +710,22 @@ MNDBGetInfo(ODBCDbc *dbc, case SQL_MAX_COLUMNS_IN_TABLE: case SQL_MAX_CONCURRENT_ACTIVITIES: case SQL_MAX_CURSOR_NAME_LEN: + len = sizeof(SQLUSMALLINT); + break; case SQL_MAX_DRIVER_CONNECTIONS: + nValue = 64; /* default value of mserver5 */ + /* TODO query the server for the actual value via SQL: + SELECT value FROM sys.env() WHERE name = 'max_clients'; */ + len = sizeof(SQLUSMALLINT); + break; case SQL_MAX_IDENTIFIER_LEN: + nValue = 1024; /* max length of columns sys.*.name is defined as 1024 */ + len = sizeof(SQLUSMALLINT); + break; case SQL_MAX_INDEX_SIZE: _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list