Changeset: 69ecf7008711 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=69ecf7008711
Modified Files:
monetdb5/misc/Makefile.ag
monetdb5/misc/msabaoth.c
monetdb5/misc/msabaoth.h
monetdb5/modules/mal/Makefile.ag
sql/backends/monet5/Makefile.ag
sql/include/sql_catalog.h
sql/server/rel_dump.c
sql/server/rel_schema.c
sql/server/rel_select.c
sql/server/sql_mvc.c
sql/server/sql_parser.y
sql/server/sql_scan.c
sql/storage/store.c
Branch: sciql
Log Message:
merged from default
diffs (truncated from 5326 to 300 lines):
diff --git a/NT/wincompile.py b/NT/wincompile.py
--- a/NT/wincompile.py
+++ b/NT/wincompile.py
@@ -76,4 +76,7 @@ p = subprocess.Popen(argv, shell = False
out, err = p.communicate()
sys.stdout.write(out.replace('\r\n', '\n'))
sys.stderr.write(err.replace('\r\n', '\n'))
+if p.returncode and not verbose:
+ sys.stderr.write('failed invocation: %s\n' % ' '.join(argv))
+ sys.stderr.flush()
sys.exit(p.returncode)
diff --git a/buildtools/Mx/Code.c b/buildtools/Mx/Code.c
--- a/buildtools/Mx/Code.c
+++ b/buildtools/Mx/Code.c
@@ -341,8 +341,7 @@ CodeSubBlk(char *sub, char **argv)
outofmem:
Error("Limit of %d characters per block reached.", blk_size);
exit(1);
- return 0;
-
+ return NULL; /* icc demands this, clang-3.0 chokes on it */
}
void
diff --git a/buildtools/Mx/Def.c b/buildtools/Mx/Def.c
--- a/buildtools/Mx/Def.c
+++ b/buildtools/Mx/Def.c
@@ -281,12 +281,14 @@ MakeDefs(char *name)
if (allTrue()) {
d = NwDef(dir, mod, sec, lino, file);
/* specially for Windows: replace all /'s with
DIR_SEP's */
- if (DIR_SEP != '/') {
+#if DIR_SEP != '/'
+ {
char *tmp = cmd;
while ((tmp = strchr(tmp, '/')) != NULL)
*tmp++ = DIR_SEP;
}
+#endif
d->d_cmd = cmd;
lastdir = Continue;
}
@@ -361,7 +363,6 @@ MakeDefs(char *name)
break;
default:
Fatal("MakeDefs", "Unknown directive:%c%c", MARK, dir);
- break;
}
}
d = NwDef(Efile, mod, sec, mx_line, mx_file);
diff --git a/buildtools/Mx/Mx.c b/buildtools/Mx/Mx.c
--- a/buildtools/Mx/Mx.c
+++ b/buildtools/Mx/Mx.c
@@ -146,8 +146,7 @@ main(int argc, char **argv)
if (mode & M_DRAFT)
GenForm();
- exit(mx_err ? 1 : 0);
- return 1;
+ return(mx_err ? 1 : 0);
}
Directive str2dir[] = {
diff --git a/buildtools/Mx/Tok.c b/buildtools/Mx/Tok.c
--- a/buildtools/Mx/Tok.c
+++ b/buildtools/Mx/Tok.c
@@ -122,7 +122,7 @@ NxtTok(Tok * t)
if (!HideDir(t->t_dir))
for (; t->t_nxt[0]; t->t_nxt++) {
- if ((t->t_nxt[0] == '\n'))
+ if (t->t_nxt[0] == '\n')
break;
if ((t->t_nxt[0] == MARK) && (t->t_nxt[-1] !=
'\\'))
break;
diff --git a/buildtools/conf/rules.mk b/buildtools/conf/rules.mk
--- a/buildtools/conf/rules.mk
+++ b/buildtools/conf/rules.mk
@@ -26,7 +26,7 @@ MX = $(top_builddir)/buildtools/Mx/Mx
# first, also with bison-generated files. This is crucial
# to prevent inconsistent (re-)definitions of macros.
%.tab.c: %.y
- $(LOCKFILE) waiting
+ touch waiting.$$$$ && until ln waiting.$$$$ waiting 2>/dev/null; do
sleep 1; done && rm waiting.$$$$
$(YACC) $(YFLAGS) $(AM_YFLAGS) $< || { $(RM) waiting ; exit 1 ; }
if [ -f y.tab.c ]; then $(MV) y.tab.c $*.tab.c ; fi
$(MV) $*.tab.c $*.tab.c.tmp
@@ -37,14 +37,14 @@ MX = $(top_builddir)/buildtools/Mx/Mx
$(RM) waiting
%.tab.h: %.y
- $(LOCKFILE) waiting
+ touch waiting.$$$$ && until ln waiting.$$$$ waiting 2>/dev/null; do
sleep 1; done && rm waiting.$$$$
$(YACC) $(YFLAGS) $(AM_YFLAGS) $< || { $(RM) waiting ; exit 1 ; }
if [ -f y.tab.h ]; then $(MV) y.tab.h $*.tab.h ; fi
[ ! -f y.tab.c ] || $(RM) y.tab.c
$(RM) waiting
%.yy.c: %.l
- $(LOCKFILE) waiting
+ touch waiting.$$$$ && until ln waiting.$$$$ waiting 2>/dev/null; do
sleep 1; done && rm waiting.$$$$
$(LEX) $(LFLAGS) $(AM_LFLAGS) $< || { $(RM) waiting ; exit 1 ; }
if [ -f $(LEX_OUTPUT_ROOT).c ]; then $(MV) $(LEX_OUTPUT_ROOT).c $*.yy.c
; fi
$(MV) $*.yy.c $*.yy.c.tmp
diff --git a/clients/ChangeLog.Dec2011 b/clients/ChangeLog.Dec2011
--- a/clients/ChangeLog.Dec2011
+++ b/clients/ChangeLog.Dec2011
@@ -1,6 +1,15 @@
# ChangeLog file for clients
# This file is updated with Maddlog
+* Wed Dec 7 2011 Fabian Groffen <[email protected]>
+- Fix making connections with stethoscope to hosts without monetdbd.
+ Bug #2944.
+
+* Tue Dec 6 2011 Fabian Groffen <[email protected]>
+- Fixed some bugs in the PHP interface affecting the mapi_ping(),
+ monetdb_insert_id() and auto_commit() functions. Bugs #2936, #2937,
+ #2938.
+
* Tue Nov 15 2011 Sjoerd Mullender <[email protected]>
- ODBC: Fixed SQLNumResultCols and SQLDescribeCol to return useful
information after a call to SQLPrepare and before any SQLExecute.
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -375,6 +375,21 @@ char *mo_find_option(opt *set, int setle
void mo_free_options(opt *set, int setlen);
void mo_print_options(opt *set, int setlen);
int mo_system_config(opt **Set, int setlen);
+char *msab_deserialise(sabdb **ret, char *sabdb);
+char *msab_freeStatus(sabdb **ret);
+char *msab_getDBfarm(char **ret);
+char *msab_getDBname(char **ret);
+char *msab_getMyStatus(sabdb **ret);
+char *msab_getStatus(sabdb **ret, char *dbname);
+char *msab_getUplogInfo(sabuplog *ret, const sabdb *db);
+void msab_init(char *dbfarm, char *dbname);
+char *msab_marchConnection(const char *host, const int port);
+char *msab_marchScenario(const char *lang);
+char *msab_registerStart(void);
+char *msab_registerStop(void);
+char *msab_retreatScenario(const char *lang);
+char *msab_serialise(char **ret, const sabdb *db);
+char *msab_wildRetreat(void);
const oid oid_nil;
DIR *opendir(const char *dirname);
void print_trace(void);
@@ -6044,21 +6059,6 @@ int moreClients(int reruns);
void moveInstruction(MalBlkPtr mb, int pc, int target);
lng msComputeTime;
lng msFindTime;
-char *msab_deserialise(sabdb **ret, char *sabdb);
-char *msab_freeStatus(sabdb **ret);
-char *msab_getDBfarm(char **ret);
-char *msab_getDBname(char **ret);
-char *msab_getMyStatus(sabdb **ret);
-char *msab_getStatus(sabdb **ret, char *dbname);
-char *msab_getUplogInfo(sabuplog *ret, const sabdb *db);
-void msab_init(char *dbfarm, char *dbname);
-char *msab_marchConnection(const char *host, const int port);
-char *msab_marchScenario(const char *lang);
-char *msab_registerStart(void);
-char *msab_registerStop(void);
-char *msab_retreatScenario(const char *lang);
-char *msab_serialise(char **ret, const sabdb *db);
-char *msab_wildRetreat(void);
str mtimeRef;
str multiplexRef;
str mvcRef;
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -238,6 +238,7 @@ doProfile(void *d)
MapiHdl hdl = NULL;
/* set up the profiler */
+ id[0] = '\0';
dbh = mapi_mapiuri(wthr->uri, wthr->user, wthr->pass, "mal");
if (dbh == NULL || mapi_error(dbh))
die(dbh, hdl);
@@ -248,7 +249,6 @@ doProfile(void *d)
snprintf(id, 10, "[%d] ", wthr->tid);
printf("-- connection with server %s is %s\n", wthr->uri, id);
} else {
- id[0] = '\0';
printf("-- connection with server %s\n", wthr->uri);
}
@@ -437,7 +437,7 @@ main(int argc, char **argv)
dbname = "";
}
- if (alts == NULL) {
+ if (alts == NULL || *alts == NULL) {
/* nothing to redirect, so a single host to try */
char uri[512];
snprintf(uri, 512, "mapi:monetdb://%s:%d/%s", host, portnr,
dbname);
@@ -465,31 +465,26 @@ main(int argc, char **argv)
} else {
/* fork runner threads for all alternatives */
i = 1;
- if (*alts != NULL) {
- walk = thds = malloc(sizeof(wthread));
- while (1) {
- walk->tid = i++;
- walk->uri = *alts;
- walk->user = user;
- walk->pass = password;
- walk->argc = argc - a;
- walk->argv = &argv[a];
- walk->s = NULL;
+ walk = thds = malloc(sizeof(wthread));
+ while (1) {
+ walk->tid = i++;
+ walk->uri = *alts;
+ walk->user = user;
+ walk->pass = password;
+ walk->argc = argc - a;
+ walk->argv = &argv[a];
+ walk->s = NULL;
#if !defined(HAVE_PTHREAD_H) && defined(_MSC_VER)
- walk->id = CreateThread(NULL, 0, doProfile,
walk, 0, NULL);
+ walk->id = CreateThread(NULL, 0, doProfile, walk, 0,
NULL);
#else
- pthread_create(&walk->id, NULL, &doProfile,
walk);
+ pthread_create(&walk->id, NULL, &doProfile, walk);
#endif
- alts++;
- if (*alts == NULL)
- break;
- walk = walk->next = malloc(sizeof(wthread));
- }
- walk->next = NULL;
- } else {
- fprintf(stderr, "%s: no databases found for '%s'\n",
- argv[0], dbname);
+ alts++;
+ if (*alts == NULL)
+ break;
+ walk = walk->next = malloc(sizeof(wthread));
}
+ walk->next = NULL;
free(oalts);
for (walk = thds; walk != NULL; walk = walk->next) {
#if !defined(HAVE_PTHREAD_H) && defined(_MSC_VER)
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
@@ -1009,6 +1009,8 @@ ODBCFetch(ODBCStmt *stmt,
TIMESTAMP_STRUCT tsval;
double fval = 0;
+ assert(ptr != NULL);
+
ird = stmt->ImplRowDescr;
ard = stmt->ApplRowDescr;
@@ -1022,13 +1024,13 @@ ODBCFetch(ODBCStmt *stmt,
ardrec = col <= ard->sql_desc_count ? &ard->descRec[col] : NULL;
sql_type = irdrec->sql_desc_concise_type;
- if (ptr && offset)
- ptr = (SQLPOINTER) ((char *) ptr + offset + row * (bind_type ==
SQL_BIND_BY_COLUMN ? sizeof(SQLPOINTER) : bind_type));
+ if (offset > 0)
+ ptr = (SQLPOINTER) ((char *) ptr + offset);
- if (lenp && offset)
- lenp = (SQLLEN *) ((char *) lenp + offset + row * (bind_type ==
SQL_BIND_BY_COLUMN ? sizeof(SQLINTEGER) : bind_type));
- if (nullp && offset)
- nullp = (SQLLEN *) ((char *) nullp + offset + row * (bind_type
== SQL_BIND_BY_COLUMN ? sizeof(SQLINTEGER) : bind_type));
+ if (lenp)
+ lenp = (SQLLEN *) ((char *) lenp + offset + row * (bind_type ==
SQL_BIND_BY_COLUMN ? sizeof(*lenp) : bind_type));
+ if (nullp)
+ nullp = (SQLLEN *) ((char *) nullp + offset + row * (bind_type
== SQL_BIND_BY_COLUMN ? sizeof(*nullp) : bind_type));
/* translate default type */
/* note, type can't be SQL_ARD_TYPE since when this function
@@ -1233,9 +1235,12 @@ ODBCFetch(ODBCStmt *stmt,
if (type == SQL_C_WCHAR) {
/* allocate temporary space */
buflen = 511; /* should be enough for most types */
- if (sql_type == SQL_CHAR && data != NULL)
- buflen = (SQLLEN) datalen; /* but this is
certainly enough for strings */
- ptr = malloc(buflen + 1);
+ if (data != NULL &&
+ (sql_type == SQL_CHAR ||
+ sql_type == SQL_VARCHAR ||
+ sql_type == SQL_LONGVARCHAR))
+ buflen = (SQLLEN) datalen + 1; /* but this is
certainly enough for strings */
+ ptr = malloc(buflen);
lenp = NULL;
}
diff --git a/clients/odbc/driver/ODBCGlobal.h b/clients/odbc/driver/ODBCGlobal.h
--- a/clients/odbc/driver/ODBCGlobal.h
+++ b/clients/odbc/driver/ODBCGlobal.h
@@ -95,18 +95,20 @@
#ifdef SQLLEN /* it's a define for 32, a typedef for 64 */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list