Changeset: 17fc3c89530c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=17fc3c89530c
Modified Files:
gdk/gdk_logger.c
monetdb5/mal/mal_import.c
sql/backends/monet5/sql_statistics.c
Branch: transaction-replication
Log Message:
Merge with default
diffs (123 lines):
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -831,7 +831,7 @@ logger_readlog(logger *lg, char *filenam
switch (l.flag) {
case LOG_START:
if (l.nr > lg->tid)
- lg->tid = l.nr;
+ lg->tid = (int)l.nr;
tr = tr_create(tr, (int)l.nr);
if (lg->debug & 1)
fprintf(stderr, "#logger tstart %d\n", tr->tid);
@@ -1883,7 +1883,6 @@ log_delta(logger *lg, BAT *b, char *name
int ok = GDK_SUCCEED;
logformat l;
BUN p;
- BUN nr;
if (lg->debug & 128) {
/* logging is switched off */
@@ -1891,10 +1890,8 @@ log_delta(logger *lg, BAT *b, char *name
}
l.tid = lg->tid;
- nr = (BUNlast(b) - BUNfirst(b));
- assert(nr <= GDK_lng_max);
- l.nr = nr;
- lg->changes += l.nr;
+ l.nr = (BUNlast(b) - BUNfirst(b));
+ lg->changes += (size_t)l.nr;
if (l.nr) {
BATiter bi = bat_iterator(b);
@@ -1936,7 +1933,7 @@ log_bat(logger *lg, BAT *b, char *name)
l.tid = lg->tid;
l.nr = (BUNlast(b) - b->batInserted);
- lg->changes += l.nr;
+ lg->changes += (size_t)l.nr;
if (l.nr) {
BATiter bi = bat_iterator(b);
@@ -1954,7 +1951,7 @@ log_bat(logger *lg, BAT *b, char *name)
!isVIEW(b)) {
const void *t = BUNtail(bi, b->batInserted);
- ok = wt(t, lg->log, l.nr);
+ ok = wt(t, lg->log, (size_t)l.nr);
} else {
for (p = b->batInserted; p < BUNlast(b) && ok ==
GDK_SUCCEED; p++) {
const void *h = BUNhead(bi, p);
@@ -1969,7 +1966,7 @@ log_bat(logger *lg, BAT *b, char *name)
fprintf(stderr, "#Logged %s " LLFMT " inserts\n", name,
l.nr);
}
l.nr = (b->batFirst - b->batDeleted);
- lg->changes += l.nr;
+ lg->changes += (size_t)l.nr;
if (l.nr && ok == GDK_SUCCEED) {
BATiter bi = bat_iterator(b);
@@ -2009,7 +2006,7 @@ log_bat_clear(logger *lg, char *name)
l.nr = 1;
l.tid = lg->tid;
- lg->changes += l.nr;
+ lg->changes += (size_t)l.nr;
l.flag = LOG_CLEAR;
if (log_write_format(lg, &l) == LOG_ERR ||
diff --git a/monetdb5/mal/mal_import.c b/monetdb5/mal/mal_import.c
--- a/monetdb5/mal/mal_import.c
+++ b/monetdb5/mal/mal_import.c
@@ -262,8 +262,8 @@ evalFile(Client c, str fname, int listin
while ((p = strchr(filename, PATH_SEP)) != NULL) {
*p = '\0';
fd = malOpenSource(filename);
- if (mnstr_errnr(fd) == MNSTR_OPEN_ERROR) {
- mnstr_destroy(fd);
+ if (fd == 0 || mnstr_errnr(fd) == MNSTR_OPEN_ERROR) {
+ if(fd) mnstr_destroy(fd);
mnstr_printf(c->fdout, "#WARNING: could not open file:
%s\n",
filename);
} else {
@@ -277,10 +277,9 @@ evalFile(Client c, str fname, int listin
filename = p + 1;
}
fd = malOpenSource(filename);
- if (mnstr_errnr(fd) == MNSTR_OPEN_ERROR) {
- mnstr_destroy(fd);
- mnstr_printf(c->fdout, "#WARNING: could not open file: %s\n",
- filename);
+ if (fd == 0 || mnstr_errnr(fd) == MNSTR_OPEN_ERROR) {
+ if( fd == 0) mnstr_destroy(fd);
+ msg = createException(MAL,"mal.eval", "WARNING: could not open
file: %s\n", filename);
} else {
c->srcFile = filename;
c->yycur = 0;
diff --git a/sql/backends/monet5/sql_statistics.c
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -111,17 +111,15 @@ sql_analyze(Client cntxt, MalBlkPtr mb,
bsample = NULL;
br = BATsubselect(bn, bsample,
ATOMnilptr(bn->ttype), ATOMnilptr(bn->ttype), 0, 0, 0);
nils = BATcount(br);
- BBPunfix(br->batCacheid);
- if (bn->tkey)
+ if (br->tkey)
uniq = sz;
else {
- br =
BATkunique(BATmirror(bsample));
- uniq = BATcount(br);
-
BBPunfix(br->batCacheid);
+ br =
BATkunique(BATmirror(br));
+ uniq = br?
BATcount(br):0;
}
- if (samplesize > 0) {
+ BBPunfix(br->batCacheid);
+ if( bsample)
BBPunfix(bsample->batCacheid);
- }
sorted = BATtordered(bn);
// Gather the min/max value for
builtin types
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list