Changeset: bc1cc97b9678 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bc1cc97b9678
Added Files:
clients/odbc/samples/arraytest.c
Modified Files:
NT/rules.msc
buildtools/Mx/Sys.c
clients/mapiclient/Makefile.ag
clients/mapiclient/mnc.c
clients/mapiclient/stethoscope.c
clients/mapilib/mapi.c
clients/odbc/driver/ODBCConvert.c
clients/odbc/driver/ODBCDbc.c
clients/odbc/driver/ODBCDbc.h
clients/odbc/driver/ODBCEnv.c
clients/odbc/driver/ODBCEnv.h
clients/odbc/driver/ODBCError.c
clients/odbc/driver/ODBCError.h
clients/odbc/driver/ODBCGlobal.h
clients/odbc/driver/ODBCStmt.c
clients/odbc/driver/ODBCStmt.h
clients/odbc/driver/ODBCUtil.c
clients/odbc/driver/ODBCUtil.h
clients/odbc/driver/SQLAllocConnect.c
clients/odbc/driver/SQLAllocEnv.c
clients/odbc/driver/SQLAllocHandle.c
clients/odbc/driver/SQLAllocStmt.c
clients/odbc/driver/SQLBindCol.c
clients/odbc/driver/SQLBindParameter.c
clients/odbc/driver/SQLBrowseConnect.c
clients/odbc/driver/SQLBulkOperations.c
clients/odbc/driver/SQLCancel.c
clients/odbc/driver/SQLCloseCursor.c
clients/odbc/driver/SQLColAttribute.c
clients/odbc/driver/SQLColAttributes.c
clients/odbc/driver/SQLColumnPrivileges.c
clients/odbc/driver/SQLConnect.c
clients/odbc/driver/SQLCopyDesc.c
clients/odbc/driver/SQLDataSources.c
clients/odbc/driver/SQLDescribeCol.c
clients/odbc/driver/SQLDescribeParam.c
clients/odbc/driver/SQLDisconnect.c
clients/odbc/driver/SQLDriverConnect.c
clients/odbc/driver/SQLEndTran.c
clients/odbc/driver/SQLError.c
clients/odbc/driver/SQLExecDirect.c
clients/odbc/driver/SQLExecute.c
clients/odbc/driver/SQLExtendedFetch.c
clients/odbc/driver/SQLFetch.c
clients/odbc/driver/SQLFetchScroll.c
clients/odbc/driver/SQLForeignKeys.c
clients/odbc/driver/SQLFreeConnect.c
clients/odbc/driver/SQLFreeEnv.c
clients/odbc/driver/SQLFreeHandle.c
clients/odbc/driver/SQLFreeStmt.c
clients/odbc/driver/SQLGetConnectAttr.c
clients/odbc/driver/SQLGetConnectOption.c
clients/odbc/driver/SQLGetCursorName.c
clients/odbc/driver/SQLGetData.c
clients/odbc/driver/SQLGetDescField.c
clients/odbc/driver/SQLGetDescRec.c
clients/odbc/driver/SQLGetDiagField.c
clients/odbc/driver/SQLGetDiagRec.c
clients/odbc/driver/SQLGetEnvAttr.c
clients/odbc/driver/SQLGetFunctions.c
clients/odbc/driver/SQLGetInfo.c
clients/odbc/driver/SQLGetStmtAttr.c
clients/odbc/driver/SQLGetStmtOption.c
clients/odbc/driver/SQLGetTypeInfo.c
clients/odbc/driver/SQLMoreResults.c
clients/odbc/driver/SQLNativeSql.c
clients/odbc/driver/SQLNumParams.c
clients/odbc/driver/SQLNumResultCols.c
clients/odbc/driver/SQLParamData.c
clients/odbc/driver/SQLParamOptions.c
clients/odbc/driver/SQLPrepare.c
clients/odbc/driver/SQLPrimaryKeys.c
clients/odbc/driver/SQLProcedureColumns.c
clients/odbc/driver/SQLProcedures.c
clients/odbc/driver/SQLPutData.c
clients/odbc/driver/SQLRowCount.c
clients/odbc/driver/SQLSetConnectAttr.c
clients/odbc/driver/SQLSetConnectOption.c
clients/odbc/driver/SQLSetCursorName.c
clients/odbc/driver/SQLSetDescField.c
clients/odbc/driver/SQLSetDescRec.c
clients/odbc/driver/SQLSetEnvAttr.c
clients/odbc/driver/SQLSetParam.c
clients/odbc/driver/SQLSetPos.c
clients/odbc/driver/SQLSetScrollOptions.c
clients/odbc/driver/SQLSetStmtAttr.c
clients/odbc/driver/SQLSetStmtOption.c
clients/odbc/driver/SQLSpecialColumns.c
clients/odbc/driver/SQLStatistics.c
clients/odbc/driver/SQLTablePrivileges.c
clients/odbc/driver/SQLTables.c
clients/odbc/driver/SQLTransact.c
clients/odbc/samples/Makefile.ag
common/stream/stream.c
gdk/gdk_utils.mx
monetdb5/extras/jaql/Tests/All
monetdb5/extras/jaql/jaql.c
monetdb5/extras/jaql/jaqlgencode.c
monetdb5/extras/jaql/jaqlscenario.c
monetdb5/extras/jaql/jaqltests/Tests/All
monetdb5/mal/mal_interpreter.mx
monetdb5/modules/mal/mat.mx
monetdb5/modules/mal/remote.c
monetdb5/optimizer/Tests/All
monetdb5/optimizer/Tests/mat00.stable.out
monetdb5/optimizer/Tests/mat01.mal
monetdb5/optimizer/Tests/mat01.stable.out
monetdb5/optimizer/opt_centipede.mx
monetdb5/optimizer/opt_groups.mx
monetdb5/optimizer/opt_octopus.mx
monetdb5/optimizer/opt_pipes.c
monetdb5/scheduler/srvpool.c
sql/backends/monet5/sql_result.mx
sql/server/rel_dump.c
sql/server/sql_datetime.c
sql/server/sql_statement.c
sql/server/sql_statement.h
testing/Mfilter.py.in
testing/Mtest.py.in
Branch: sciql
Log Message:
merged from default
diffs (truncated from 3949 to 300 lines):
diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -385,6 +385,11 @@ create_winconfig_conds_new_py:
!ELSE
$(ECHO) HAVE_SQL_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
!ENDIF
+!IFDEF HAVE_JAQL
+ $(ECHO) HAVE_JAQL_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
+!ELSE
+ $(ECHO) HAVE_JAQL_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
+!ENDIF
!IFDEF HAVE_TESTING
$(ECHO) HAVE_TESTING_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
!ELSE
diff --git a/buildtools/Mx/Sys.c b/buildtools/Mx/Sys.c
--- a/buildtools/Mx/Sys.c
+++ b/buildtools/Mx/Sys.c
@@ -30,7 +30,6 @@
int mx_out = 1;
extern int somethingPrinted; /* used for preventing to empty display lines */
-/* VARARGS */
void
ofile_printf(const char *format, ...)
{
diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag
--- a/clients/mapiclient/Makefile.ag
+++ b/clients/mapiclient/Makefile.ag
@@ -42,7 +42,7 @@ bin_stethoscope = {
SOURCES = stethoscope.c
LIBS = libmcutil ../mapilib/libmapi \
../../common/stream/libstream \
- $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS)
+ $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS) $(SOCKET_LIBS)
}
bin_mnc = {
diff --git a/clients/mapiclient/mnc.c b/clients/mapiclient/mnc.c
--- a/clients/mapiclient/mnc.c
+++ b/clients/mapiclient/mnc.c
@@ -99,7 +99,7 @@ main(int argc, char **argv)
stream *in = NULL;
stream *out = NULL;
char buf[8096];
- size_t len;
+ ssize_t len;
fd_set fds;
char seeneof = 0;
char seenflush = 0;
@@ -271,8 +271,11 @@ main(int argc, char **argv)
select((int)s + 1, &fds, NULL, NULL, NULL);
if (FD_ISSET(s, &fds)) {
- if ((len = mnstr_read(in, buf, 1, sizeof(buf))) != 0) {
- if (!write(1, buf, len))
+ if ((len = mnstr_read(in, buf, 1, sizeof(buf))) > 0) {
+ /* on Windows: unsigned int,
+ * elsewhere: size_t, but then
+ * unsigned int shouldn't harm */
+ if (!write(1, buf, (unsigned int) len))
exit(2);
seenflush = 0;
} else {
@@ -285,8 +288,8 @@ main(int argc, char **argv)
}
}
if (FD_ISSET(0, &fds)) {
- if ((len = read(0, buf, sizeof(buf))) != 0) {
- mnstr_write(out, buf, len, 1);
+ if ((len = read(0, buf, sizeof(buf))) > 0) {
+ mnstr_write(out, buf, (size_t) len, 1);
seeneof = 0;
} else if (len == 0) {
/* EOF */
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -17,11 +17,6 @@
* All Rights Reserved.
*/
-/**
- * stethoscope
- * author Martin Kersten
- */
-
#include "monetdb_config.h"
#include "monet_options.h"
#include <mapi.h>
@@ -107,6 +102,7 @@ typedef struct _wthread {
} wthread;
static wthread *thds = NULL;
+static char hostname[128];
static void
usage(void)
@@ -243,10 +239,11 @@ doProfile(void *d)
goto stop_cleanup;
}
- printf("-- %sopened UDP profile stream for %s:%d\n", id, host, portnr);
+ printf("-- %sopened UDP profile stream %s:%d for %s\n",
+ id, hostname, portnr, host);
snprintf(buf, BUFSIZ, "port := profiler.openStream(\"%s\", %d);",
- host, portnr);
+ hostname, portnr);
doQ(buf);
/* Set Filters */
@@ -452,6 +449,9 @@ main(int argc, char **argv)
close(0); /* get rid of stdin */
+ /* our hostname, how remote servers have to contact us */
+ gethostname(hostname, sizeof(hostname));
+
/* try and find multiple options, we assume that we always need a
* local merovingian for that, in the future we probably need to fix
* this in a decent manner */
@@ -507,7 +507,6 @@ main(int argc, char **argv)
if (*alts == NULL)
break;
walk = walk->next = malloc(sizeof(wthread));
- printf("Alternative route created '%s'\n",walk->uri);
}
walk->next = NULL;
free(oalts);
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -2554,7 +2554,7 @@ mapi_start_talking(Mapi mid)
* commas, and only allow full matches */
if (strstr(hashes, *algs) != NULL) {
char *pwh = mcrypt_hashPassword(*algs,
p, chal);
- int len;
+ size_t len;
if (pwh == NULL)
continue;
len = strlen(pwh) + 11 /* {RIPEMD160}
*/ + 1;
diff --git a/clients/odbc/driver/ODBCConvert.c
b/clients/odbc/driver/ODBCConvert.c
--- a/clients/odbc/driver/ODBCConvert.c
+++ b/clients/odbc/driver/ODBCConvert.c
@@ -25,6 +25,7 @@
#ifdef HAVE_STRINGS_H
#include <strings.h> /* for strncasecmp */
#endif
+#include <float.h> /* for FLT_MAX */
#if SIZEOF_INT==8
# define ULL_CONSTANT(val) (val)
@@ -520,7 +521,7 @@ parseoptionalbracketednumber(char **sval
sval = eptr;
*val2p = val;
}
-
+
if (slen == 0 || *sval != ')')
return SQL_ERROR;
slen--;
@@ -529,7 +530,7 @@ parseoptionalbracketednumber(char **sval
*slenp = slen;
return SQL_SUCCESS;
}
-
+
static SQLRETURN
parsemonthintervalstring(char **svalp,
SQLLEN *slenp,
@@ -2256,13 +2257,12 @@ ODBCFetch(ODBCStmt *stmt,
if (type == SQL_C_FLOAT) {
if (ardrec && row > 0)
ptr = (SQLPOINTER) ((char *) ptr + row *
(bind_type == SQL_BIND_BY_COLUMN ? sizeof(float) : bind_type));
- *(float *) ptr = (float) fval;
-
- if ((double) *(float *) ptr != fval) {
+ if (fval < -FLT_MAX || fval > FLT_MAX) {
/* Numeric value out of range */
addStmtError(stmt, "22003", NULL, 0);
return SQL_ERROR;
}
+ *(float *) ptr = (float) fval;
if (lenp)
*lenp = sizeof(float);
} else {
@@ -2715,7 +2715,7 @@ ODBCStore(ODBCStmt *stmt,
{
ODBCDescRec *ipdrec, *apdrec;
SQLPOINTER ptr;
- SQLLEN *indicator_ptr;
+ SQLLEN *strlen_or_ind_ptr;
SQLUINTEGER bind_type;
SQLSMALLINT ctype, sqltype;
char *sval = NULL;
@@ -2742,11 +2742,11 @@ ODBCStore(ODBCStmt *stmt,
ptr = apdrec->sql_desc_data_ptr;
if (ptr && offset)
ptr = (SQLPOINTER) ((char *) ptr + offset + row * (bind_type ==
SQL_BIND_BY_COLUMN ? sizeof(SQLPOINTER) : bind_type));
- indicator_ptr = apdrec->sql_desc_indicator_ptr;
- if (indicator_ptr && offset)
- indicator_ptr = (SQLLEN *) ((char *) indicator_ptr + offset +
row * (bind_type == SQL_BIND_BY_COLUMN ? sizeof(SQLINTEGER) : bind_type));
+ strlen_or_ind_ptr = apdrec->sql_desc_indicator_ptr;
+ if (strlen_or_ind_ptr && offset)
+ strlen_or_ind_ptr = (SQLLEN *) ((char *) strlen_or_ind_ptr +
offset + row * (bind_type == SQL_BIND_BY_COLUMN ? sizeof(SQLINTEGER) :
bind_type));
if (ptr == NULL &&
- (indicator_ptr == NULL || *indicator_ptr != SQL_NULL_DATA)) {
+ (strlen_or_ind_ptr == NULL || *strlen_or_ind_ptr != SQL_NULL_DATA))
{
/* COUNT field incorrect */
addStmtError(stmt, "07002", NULL, 0);
return SQL_ERROR;
@@ -2771,7 +2771,7 @@ ODBCStore(ODBCStmt *stmt,
break;
}
- if (indicator_ptr != NULL && *indicator_ptr == SQL_NULL_DATA) {
+ if (strlen_or_ind_ptr != NULL && *strlen_or_ind_ptr == SQL_NULL_DATA) {
assigns(buf, bufpos, buflen, "NULL", stmt);
*bufp = buf;
*bufposp = bufpos;
@@ -2779,16 +2779,20 @@ ODBCStore(ODBCStmt *stmt,
return SQL_SUCCESS;
}
+ strlen_or_ind_ptr = apdrec->sql_desc_octet_length_ptr;
+ if (strlen_or_ind_ptr && offset)
+ strlen_or_ind_ptr = (SQLLEN *) ((char *) strlen_or_ind_ptr +
offset + row * (bind_type == SQL_BIND_BY_COLUMN ? sizeof(SQLINTEGER) :
bind_type));
+
switch (ctype) {
case SQL_C_CHAR:
case SQL_C_BINARY:
- slen = apdrec->sql_desc_octet_length_ptr ?
*apdrec->sql_desc_octet_length_ptr : SQL_NTS;
+ slen = strlen_or_ind_ptr ? *strlen_or_ind_ptr : SQL_NTS;
sval = (char *) ptr;
fixODBCstring(sval, slen, SQLLEN, addStmtError, stmt, return
SQL_ERROR);
break;
#ifdef WITH_WCHAR
case SQL_C_WCHAR:
- slen = apdrec->sql_desc_octet_length_ptr ?
*apdrec->sql_desc_octet_length_ptr : SQL_NTS;
+ slen = strlen_or_ind_ptr ? *strlen_or_ind_ptr : SQL_NTS;
sval = (char *) ptr;
fixWcharIn((SQLWCHAR *) ptr, slen, char, sval, addStmtError,
stmt, return SQL_ERROR);
break;
@@ -3667,7 +3671,7 @@ ODBCStore(ODBCStmt *stmt,
fval = (double) (60 * (60 * (24 *
ival.intval.day_second.day + ival.intval.day_second.hour) +
ival.intval.day_second.minute) + ival.intval.day_second.second);
if (ival.intval.day_second.fraction && ivalprec > 0) {
int f = 1;
-
+
for (i = 0; i < ivalprec; i++)
f *= 10;
fval += ival.intval.day_second.fraction /
(double) f;
diff --git a/clients/odbc/driver/ODBCDbc.c b/clients/odbc/driver/ODBCDbc.c
--- a/clients/odbc/driver/ODBCDbc.c
+++ b/clients/odbc/driver/ODBCDbc.c
@@ -22,7 +22,7 @@
* This code is LGPL. Please ensure that this message remains in future
* distributions and uses of this code (thats about all I get out of it).
* - Peter Harvey [email protected]
- *
+ *
* This file has been modified for the MonetDB project. See the file
* Copyright in this directory for more information.
*/
diff --git a/clients/odbc/driver/ODBCDbc.h b/clients/odbc/driver/ODBCDbc.h
--- a/clients/odbc/driver/ODBCDbc.h
+++ b/clients/odbc/driver/ODBCDbc.h
@@ -22,7 +22,7 @@
* This code is LGPL. Please ensure that this message remains in future
* distributions and uses of this code (thats about all I get out of it).
* - Peter Harvey [email protected]
- *
+ *
* This file has been modified for the MonetDB project. See the file
* Copyright in this directory for more information.
*/
diff --git a/clients/odbc/driver/ODBCEnv.c b/clients/odbc/driver/ODBCEnv.c
--- a/clients/odbc/driver/ODBCEnv.c
+++ b/clients/odbc/driver/ODBCEnv.c
@@ -22,7 +22,7 @@
* This code is LGPL. Please ensure that this message remains in future
* distributions and uses of this code (thats about all I get out of it).
* - Peter Harvey [email protected]
- *
+ *
* This file has been modified for the MonetDB project. See the file
* Copyright in this directory for more information.
*/
diff --git a/clients/odbc/driver/ODBCEnv.h b/clients/odbc/driver/ODBCEnv.h
--- a/clients/odbc/driver/ODBCEnv.h
+++ b/clients/odbc/driver/ODBCEnv.h
@@ -22,7 +22,7 @@
* This code is LGPL. Please ensure that this message remains in future
* distributions and uses of this code (thats about all I get out of it).
* - Peter Harvey [email protected]
- *
+ *
* This file has been modified for the MonetDB project. See the file
* Copyright in this directory for more information.
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list