Changeset: a6644c39f110 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a6644c39f110
Modified Files:
MonetDB.spec
monetdb5/mal/mal_profiler.c
monetdb5/modules/mal/mal_io.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_rank.c
Branch: default
Log Message:
Merged with Jul2021
diffs (truncated from 497 to 300 lines):
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -124,13 +124,7 @@ BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(libpcre) >= 4.5
%endif
BuildRequires: pkgconfig(zlib)
-%if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} > 7
-# not on RHEL 7
BuildRequires: pkgconfig(liblz4) >= 1.8
-%global LZ4 ON
-%else
-%global LZ4 OFF
-%endif
%if %{with py3integration}
BuildRequires: pkgconfig(python3) >= 3.5
BuildRequires: python3-numpy
@@ -350,6 +344,13 @@ Recommends: php-monetdb >= 1.0
%endif
Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
Requires: python3-pymonetdb >= 1.0.6
+%if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} > 7
+Recommends: python3dist(lz4)
+Recommends: python3dist(scipy)
+%else
+Recommends: python36-lz4
+Recommends: python36-scipy
+%endif
%description client-tests
MonetDB is a database management system that is developed from a
@@ -796,7 +797,7 @@ fi
-DWITH_CMOCKA=OFF \
-DWITH_CRYPTO=ON \
-DWITH_CURL=ON \
- -DWITH_LZ4=%{LZ4} \
+ -DWITH_LZ4=ON \
-DWITH_LZMA=ON \
-DWITH_PCRE=ON \
-DWITH_PROJ=OFF \
diff --git a/common/utils/mcrypt.c b/common/utils/mcrypt.c
--- a/common/utils/mcrypt.c
+++ b/common/utils/mcrypt.c
@@ -385,13 +385,7 @@ mcrypt_RIPEMD160Sum(const char *string,
char *
mcrypt_BackendSum(const char *string, size_t len)
{
-#if (defined(HAVE_OPENSSL) || defined(HAVE_COMMONCRYPTO))
return mcryptsum(MONETDB5_PASSWDHASH_TOKEN)(string, len);
-#else
- (void) string;
- (void) len;
- return NULL;
-#endif
}
/**
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1391,6 +1391,7 @@ logger_switch_bat(BAT *old, BAT *new, co
}
if (BBPrename(old->batCacheid, NULL) != 0 ||
BBPrename(new->batCacheid, bak) != 0) {
+ GDKerror("rename (%s) failed\n", bak);
return GDK_FAIL;
}
BBPretain(new->batCacheid);
@@ -1799,18 +1800,6 @@ logger_load(int debug, const char *fn, c
GDKerror("cannot create type bats");
goto error;
}
- strconcat_len(bak, sizeof(bak), fn, "_type_id", NULL);
- if (BBPrename(lg->type_id->batCacheid, bak) < 0) {
- goto error;
- }
- strconcat_len(bak, sizeof(bak), fn, "_type_nme", NULL);
- if (BBPrename(lg->type_nme->batCacheid, bak) < 0) {
- goto error;
- }
- strconcat_len(bak, sizeof(bak), fn, "_type_nr", NULL);
- if (BBPrename(lg->type_nr->batCacheid, bak) < 0) {
- goto error;
- }
/* this is intentional - if catalog_bid is 0, force it to find
* the persistent catalog */
@@ -1945,19 +1934,11 @@ logger_load(int debug, const char *fn, c
GDKerror("failed to create catalog_cnt bat");
goto error;
}
- strconcat_len(bak, sizeof(bak), fn, "_catalog_cnt", NULL);
- if (BBPrename(lg->catalog_cnt->batCacheid, bak) < 0) {
- goto error;
- }
lg->catalog_lid = logbat_new(TYPE_lng, 1, TRANSIENT);
if (lg->catalog_lid == NULL) {
GDKerror("failed to create catalog_lid bat");
goto error;
}
- strconcat_len(bak, sizeof(bak), fn, "_catalog_lid", NULL);
- if (BBPrename(lg->catalog_lid->batCacheid, bak) < 0) {
- goto error;
- }
if (bm_get_counts(lg) != GDK_SUCCEED)
goto error;
@@ -2784,6 +2765,7 @@ static gdk_return
bm_commit(logger *lg)
{
BUN p;
+ logger_lock(lg);
BAT *b = lg->catalog_bid;
const log_bid *bids;
@@ -2792,10 +2774,12 @@ bm_commit(logger *lg)
log_bid bid = bids[p];
BAT *lb;
+ assert(bid);
if ((lb = BATdescriptor(bid)) == NULL ||
BATmode(lb, false) != GDK_SUCCEED) {
TRC_WARNING(GDK, "Failed to set bat (%d%s)
persistent\n", bid, !lb?" gone":"");
logbat_destroy(lb);
+ logger_unlock(lg);
return GDK_FAIL;
}
@@ -2806,6 +2790,7 @@ bm_commit(logger *lg)
fprintf(stderr, "#bm_commit: create %d (%d)\n",
bid, BBP_lrefs(bid));
}
+ logger_unlock(lg);
return bm_subcommit(lg);
}
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -1001,7 +1001,6 @@ AUTHcypherValue(str *ret, const char *va
static str
AUTHverifyPassword(const char *passwd)
{
-#if (defined(HAVE_OPENSSL) || defined(HAVE_COMMONCRYPTO))
const char *p = passwd;
size_t len = strlen(p);
@@ -1021,13 +1020,6 @@ AUTHverifyPassword(const char *passwd)
}
return(MAL_SUCCEED);
-#else
- if (GDKembedded())
- return(MAL_SUCCEED);
- (void) passwd;
- throw(MAL, "verifyPassword", "Unknown backend hash algorithm: %s",
- MONETDB5_PASSWDHASH);
-#endif
}
static BUN
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -321,8 +321,11 @@ prepareProfilerEvent(Client cntxt, MalBl
tname = getTypeName(getBatType(tpe));
ok = logadd(&logbuf, ",\"type\":\"bat[:%s]\"",
tname);
GDKfree(tname);
- if (!ok)
+ if (!ok) {
+ if (d)
+ BBPunfix(d->batCacheid);
goto cleanup_and_exit;
+ }
if(d) {
BAT *v;
cnt = BATcount(d);
@@ -335,11 +338,15 @@ prepareProfilerEvent(Client cntxt, MalBl
",\"mode\":\"%s\"",
VIEWtparent(d),
d->hseqbase,
- v &&
!v->batTransient ? "persistent" : "transient"))
- goto cleanup_and_exit;
+ v &&
!v->batTransient ? "persistent" : "transient")) {
+
BBPunfix(d->batCacheid);
+
goto cleanup_and_exit;
+ }
} else {
- if (!logadd(&logbuf,
",\"mode\":\"%s\"", (d->batTransient ? "transient" : "persistent")))
+ if (!logadd(&logbuf,
",\"mode\":\"%s\"", (d->batTransient ? "transient" : "persistent"))) {
+ BBPunfix(d->batCacheid);
goto cleanup_and_exit;
+ }
}
if (!logadd(&logbuf,
",\"sorted\":%d"
@@ -351,8 +358,10 @@ prepareProfilerEvent(Client cntxt, MalBl
d->trevsorted,
d->tnonil,
d->tnil,
- d->tkey))
+ d->tkey)) {
+ BBPunfix(d->batCacheid);
goto cleanup_and_exit;
+ }
#define keepprop(NME, LNME)
\
do {
\
const void *valp = BATgetprop(d, NME);
\
@@ -363,8 +372,10 @@ prepareProfilerEvent(Client cntxt, MalBl
ok = logadd(&logbuf, ",\"%s\":\"%s\"", LNME,
cvquote); \
GDKfree(cv);
\
GDKfree(cvquote);
\
- if (!ok)
\
+ if (!ok) {
\
+ BBPunfix(d->batCacheid);
\
goto cleanup_and_exit;
\
+ }
\
}
\
}
\
} while (0)
@@ -383,22 +394,31 @@ prepareProfilerEvent(Client cntxt, MalBl
*c = 0;
ok = logadd(&logbuf,
",\"file\":\"%s\"", cv + 1);
GDKfree(cv);
- if (!ok)
+ if (!ok) {
+ BBPunfix(d->batCacheid);
goto cleanup_and_exit;
+ }
total += cnt << d->tshift;
- if (!logadd(&logbuf, ",\"width\":%d",
d->twidth))
+ if (!logadd(&logbuf, ",\"width\":%d",
d->twidth)) {
+ BBPunfix(d->batCacheid);
goto cleanup_and_exit;
+ }
/* keeping information about the
individual auxiliary heaps is helpful during analysis. */
MT_rwlock_rdlock(&d->thashlock);
if( d->thash && !logadd(&logbuf,
",\"hash\":" LLFMT, (lng) hashinfo(d->thash, d->batCacheid))) {
MT_rwlock_rdunlock(&d->thashlock);
+ BBPunfix(d->batCacheid);
goto cleanup_and_exit;
}
MT_rwlock_rdunlock(&d->thashlock);
- if( d->tvheap && !logadd(&logbuf,
",\"vheap\":" LLFMT, (lng) heapinfo(d->tvheap, d->batCacheid)))
+ if( d->tvheap && !logadd(&logbuf,
",\"vheap\":" LLFMT, (lng) heapinfo(d->tvheap, d->batCacheid))) {
+ BBPunfix(d->batCacheid);
goto cleanup_and_exit;
- if( d->timprints && !logadd(&logbuf,
",\"imprints\":" LLFMT, (lng) IMPSimprintsize(d)))
+ }
+ if( d->timprints && !logadd(&logbuf,
",\"imprints\":" LLFMT, (lng) IMPSimprintsize(d))) {
+ BBPunfix(d->batCacheid);
goto cleanup_and_exit;
+ }
/* if (!logadd(&logbuf,
"\"debug\":\"%s\",", d->debugmessages)) goto cleanup_and_exit; */
BBPunfix(d->batCacheid);
}
diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c
--- a/monetdb5/modules/atoms/blob.c
+++ b/monetdb5/modules/atoms/blob.c
@@ -438,19 +438,19 @@ BLOBblob_blob_bulk(bat *res, const bat *
oid off;
bool nils = false;
- if ((b = BATdescriptor(*bid)) == NULL) {
- msg = createException(SQL, "batcalc.blob_blob_bulk",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
- goto bailout;
- }
if (sid && !is_bat_nil(*sid)) {
if ((s = BATdescriptor(*sid)) == NULL) {
msg = createException(SQL, "batcalc.blob_blob_bulk",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
goto bailout;
}
} else {
- BBPkeepref(*res = b->batCacheid); /* nothing to convert, return
*/
+ BBPretain(*res = *bid); /* nothing to convert, return */
return MAL_SUCCEED;
}
+ if ((b = BATdescriptor(*bid)) == NULL) {
+ msg = createException(SQL, "batcalc.blob_blob_bulk",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
+ goto bailout;
+ }
off = b->hseqbase;
q = canditer_init(&ci, b, s);
if (!(dst = COLnew(ci.hseq, TYPE_blob, q, TRANSIENT))) {
diff --git a/monetdb5/modules/atoms/uuid.c b/monetdb5/modules/atoms/uuid.c
--- a/monetdb5/modules/atoms/uuid.c
+++ b/monetdb5/modules/atoms/uuid.c
@@ -186,19 +186,19 @@ UUIDuuid2uuid_bulk(bat *res, const bat *
bool nils = false;
BATiter bi;
- if ((b = BATdescriptor(*bid)) == NULL) {
- msg = createException(SQL, "batcalc.uuid2uuidbulk",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
- goto bailout;
- }
if (sid && !is_bat_nil(*sid)) {
if ((s = BATdescriptor(*sid)) == NULL) {
msg = createException(SQL, "batcalc.uuid2uuidbulk",
SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
goto bailout;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list