Changeset: 9faff498f4cc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9faff498f4cc
Modified Files:
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
tools/monetdbe/monetdbe.c
Branch: default
Log Message:
Merged with Jul2021
diffs (177 lines):
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -178,7 +178,6 @@ BATmaterialize(BAT *b)
cnt = BATcapacity(b);
if ((tail = GDKmalloc(sizeof(Heap))) == NULL)
return GDK_FAIL;
- *tail = *b->theap;
p = 0;
q = BUNlast(b);
assert(cnt >= q - p);
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1636,10 +1636,10 @@ BUNinplacemulti(BAT *b, const oid *posit
MT_lock_set(&b->theaplock);
b->tminpos = minpos;
b->tmaxpos = maxpos;
- MT_lock_unset(&b->theaplock);
b->theap->dirty = true;
if (b->tvheap)
b->tvheap->dirty = true;
+ MT_lock_unset(&b->theaplock);
return GDK_SUCCEED;
}
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -329,7 +329,6 @@ insert_string_bat(BAT *b, BAT *n, struct
BATsetcount(b, oldcnt + ci->ncand);
bat_iterator_end(&ni);
assert(b->batCapacity >= b->batCount);
- b->theap->dirty = true;
/* maintain hash */
MT_rwlock_wrlock(&b->thashlock);
for (r = oldcnt, cnt = BATcount(b); b->thash && r < cnt; r++) {
@@ -402,7 +401,6 @@ append_varsized_bat(BAT *b, BAT *n, stru
*dst++ = src[canditer_next(ci) - hseq];
}
}
- b->theap->dirty = true;
BATsetcount(b, BATcount(b) + ci->ncand);
/* maintain hash table */
MT_rwlock_wrlock(&b->thashlock);
@@ -459,7 +457,6 @@ append_varsized_bat(BAT *b, BAT *n, stru
MT_rwlock_wrunlock(&b->thashlock);
BATsetcount(b, r);
bat_iterator_end(&ni);
- b->theap->dirty = true;
return GDK_SUCCEED;
}
@@ -873,7 +870,6 @@ BATappend2(BAT *b, BAT *n, BAT *s, bool
}
MT_rwlock_wrunlock(&b->thashlock);
BATsetcount(b, b->batCount + ci.ncand);
- b->theap->dirty = true;
}
doreturn:
@@ -1131,9 +1127,7 @@ BATappend_or_update(BAT *b, BAT *p, cons
bool anynil = false;
bool locked = false;
- b->theap->dirty = true;
if (b->tvarsized) {
- b->tvheap->dirty = true;
for (BUN i = 0; i < ni.count; i++) {
oid updid;
if (positions) {
@@ -1280,6 +1274,9 @@ BATappend_or_update(BAT *b, BAT *p, cons
MT_rwlock_wrunlock(&b->thashlock);
locked = false;
}
+ MT_lock_set(&b->theaplock);
+ b->tvheap->dirty = true;
+ MT_lock_unset(&b->theaplock);
} else if (ATOMstorage(b->ttype) == TYPE_msk) {
HASHdestroy(b); /* hash doesn't make sense for msk */
for (BUN i = 0; i < ni.count; i++) {
@@ -1561,6 +1558,7 @@ BATappend_or_update(BAT *b, BAT *p, cons
MT_lock_set(&b->theaplock);
b->tminpos = minpos;
b->tmaxpos = maxpos;
+ b->theap->dirty = true;
MT_lock_unset(&b->theaplock);
TRC_DEBUG(ALGO,
"BATreplace(" ALGOBATFMT "," ALGOOPTBATFMT "," ALGOBATFMT ")
" LLFMT " usec\n",
diff --git a/monetdb5/mal/mal_exception.c b/monetdb5/mal/mal_exception.c
--- a/monetdb5/mal/mal_exception.c
+++ b/monetdb5/mal/mal_exception.c
@@ -121,27 +121,27 @@ str
createException(enum malexception type, const char *fcn, const char *format,
...)
{
va_list ap;
- str ret = NULL;
+ str ret = NULL, localGDKerrbuf = GDKerrbuf;
- if (GDKerrbuf &&
+ if (localGDKerrbuf &&
(ret = strstr(format, MAL_MALLOC_FAIL)) != NULL &&
ret[strlen(MAL_MALLOC_FAIL)] != ':' &&
- (strncmp(GDKerrbuf, "GDKmalloc", 9) == 0 ||
- strncmp(GDKerrbuf, "GDKrealloc", 10) == 0 ||
- strncmp(GDKerrbuf, "GDKzalloc", 9) == 0 ||
- strncmp(GDKerrbuf, "GDKstrdup", 9) == 0 ||
- strncmp(GDKerrbuf, "allocating too much virtual address
space", 41) == 0)) {
+ (strncmp(localGDKerrbuf, "GDKmalloc", 9) == 0 ||
+ strncmp(localGDKerrbuf, "GDKrealloc", 10) == 0 ||
+ strncmp(localGDKerrbuf, "GDKzalloc", 9) == 0 ||
+ strncmp(localGDKerrbuf, "GDKstrdup", 9) == 0 ||
+ strncmp(localGDKerrbuf, "allocating too much virtual address
space", 41) == 0)) {
/* override errors when the underlying error is memory
* exhaustion, but include whatever it is that the GDK level
* reported */
- ret = createException(type, fcn, SQLSTATE(HY013)
MAL_MALLOC_FAIL ": %s", GDKerrbuf);
+ ret = createException(type, fcn, SQLSTATE(HY013)
MAL_MALLOC_FAIL ": %s", localGDKerrbuf);
GDKclrerr();
assert(ret);
return ret;
}
- if (strcmp(format, GDK_EXCEPTION) == 0 && GDKerrbuf[0]) {
+ if (localGDKerrbuf && localGDKerrbuf[0] && strcmp(format,
GDK_EXCEPTION) == 0) {
/* for GDK errors, report the underlying error */
- char *p = GDKerrbuf;
+ char *p = localGDKerrbuf;
if (strncmp(p, GDKERROR, strlen(GDKERROR)) == 0) {
/* error is "!ERROR: function_name: STATE!error message"
* we need to skip everything up to the STATE */
diff --git a/sql/test/BugTracker-2021/Tests/merge-table-join.Bug-7172.test
b/sql/test/BugTracker-2021/Tests/merge-table-join.Bug-7172.test
--- a/sql/test/BugTracker-2021/Tests/merge-table-join.Bug-7172.test
+++ b/sql/test/BugTracker-2021/Tests/merge-table-join.Bug-7172.test
@@ -100,8 +100,8 @@ CREATE TABLE "dw_hospital"."facts_costi_
"classe_movimento_id" INTEGER NOT NULL,
"applicativo_id" INTEGER NOT NULL,
"progetto_id" INTEGER NOT NULL,
- "valore" DECIMAL(19,4) NOT NULL,
- "quantita" DECIMAL(19,4) NOT NULL,
+ "valore" DECIMAL(12,4) NOT NULL,
+ "quantita" DECIMAL(12,4) NOT NULL,
"last_batch_id" INTEGER NOT NULL,
"archive" INTEGER NOT NULL,
"last_updated" TIMESTAMP NOT NULL DEFAULT
current_timestamp(),
@@ -122,8 +122,8 @@ CREATE TABLE "dw_hospital"."facts_costi_
"classe_movimento_id" INTEGER NOT NULL,
"applicativo_id" INTEGER NOT NULL,
"progetto_id" INTEGER NOT NULL,
- "valore" DECIMAL(19,4) NOT NULL,
- "quantita" DECIMAL(19,4) NOT NULL,
+ "valore" DECIMAL(12,4) NOT NULL,
+ "quantita" DECIMAL(12,4) NOT NULL,
"last_batch_id" INTEGER NOT NULL,
"archive" INTEGER NOT NULL,
"last_updated" TIMESTAMP NOT NULL DEFAULT
current_timestamp(),
@@ -144,8 +144,8 @@ CREATE TABLE "dw_hospital"."facts_costi_
"classe_movimento_id" INTEGER NOT NULL,
"applicativo_id" INTEGER NOT NULL,
"progetto_id" INTEGER NOT NULL,
- "valore" DECIMAL(19,4) NOT NULL,
- "quantita" DECIMAL(19,4) NOT NULL,
+ "valore" DECIMAL(12,4) NOT NULL,
+ "quantita" DECIMAL(12,4) NOT NULL,
"last_batch_id" INTEGER NOT NULL,
"archive" INTEGER NOT NULL,
"last_updated" TIMESTAMP NOT NULL DEFAULT
current_timestamp(),
@@ -166,8 +166,8 @@ CREATE MERGE TABLE "dw_hospital"."facts_
"classe_movimento_id" INTEGER NOT NULL,
"applicativo_id" INTEGER NOT NULL,
"progetto_id" INTEGER NOT NULL,
- "valore" DECIMAL(19,4) NOT NULL,
- "quantita" DECIMAL(19,4) NOT NULL,
+ "valore" DECIMAL(12,4) NOT NULL,
+ "quantita" DECIMAL(12,4) NOT NULL,
"last_batch_id" INTEGER NOT NULL,
"archive" INTEGER NOT NULL,
"last_updated" TIMESTAMP NOT NULL DEFAULT
current_timestamp(),
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list