Changeset: 1640af258fff for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1640af258fff
Modified Files:
gdk/gdk_bbp.c
Branch: multi-cachelock
Log Message:
merged with default
diffs (truncated from 13259 to 300 lines):
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -82,13 +82,13 @@
Name: %{name}
Version: %{version}
Release: %{release}
-Summary: MonetDB - Monet Database Management System
+Summary: Monet Database Management System
Vendor: MonetDB BV <[email protected]>
Group: Applications/Databases
License: MPL-2.0
URL: https://www.monetdb.org/
-BugURL: https://bugs.monetdb.org/
+BugURL: https://github.com/MonetDB/MonetDB/issues
Source:
https://www.monetdb.org/downloads/sources/Sep2022-SP2/%{name}-%{version}.tar.bz2
# The Fedora packaging document says we need systemd-rpm-macros for
@@ -144,12 +144,12 @@ BuildRequires: texlive-obsolete
%endif
%endif
# optional packages:
-# BuildRequires: pkgconfig(cmocka) # -DWITH_CMOCKA=ON
-# BuildRequires: pkgconfig(gdal) # -DSHP=ON
-# BuildRequires: pkgconfig(netcdf) # -DNETCDF=ON
-# BuildRequires: pkgconfig(proj) # -DWITH_PROJ=ON
-# BuildRequires: pkgconfig(snappy) # -DWITH_SNAPPY=ON
-# BuildRequires: pkgconfig(valgrind) # -DWITH_VALGRIND=ON
+# BuildRequires: pkgconfig(cmocka) # -DWITH_CMOCKA=ON
+# BuildRequires: pkgconfig(gdal) # -DSHP=ON
+# BuildRequires: pkgconfig(netcdf) # -DNETCDF=ON
+# BuildRequires: pkgconfig(proj) # -DWITH_PROJ=ON
+# BuildRequires: pkgconfig(snappy) # -DWITH_SNAPPY=ON
+# BuildRequires: pkgconfig(valgrind) # -DWITH_VALGRIND=ON
%if (0%{?fedora} >= 22)
Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
@@ -505,17 +505,17 @@ getent group monetdb >/dev/null || group
if getent passwd monetdb >/dev/null; then
case $(getent passwd monetdb | cut -d: -f6) in
%{_localstatedir}/MonetDB) # old value
- # change home directory, but not using usermod
- # usermod requires there to not be any running processes owned by the
user
- EDITOR='sed -i
"/^monetdb:/s|:%{_localstatedir}/MonetDB:|:%{_localstatedir}/lib/monetdb:|"'
- unset VISUAL
- export EDITOR
- /sbin/vipw > /dev/null
- ;;
+ # change home directory, but not using usermod
+ # usermod requires there to not be any running processes owned by the
user
+ EDITOR='sed -i
"/^monetdb:/s|:%{_localstatedir}/MonetDB:|:%{_localstatedir}/lib/monetdb:|"'
+ unset VISUAL
+ export EDITOR
+ /sbin/vipw > /dev/null
+ ;;
esac
else
useradd --system --gid monetdb --home-dir %{_localstatedir}/lib/monetdb \
- --shell /sbin/nologin --comment "MonetDB Server" monetdb
+ --shell /sbin/nologin --comment "MonetDB Server" monetdb
fi
exit 0
@@ -782,33 +782,33 @@ fi
%build
%cmake3 \
- -DCMAKE_INSTALL_RUNSTATEDIR=/run \
- -DRELEASE_VERSION=ON \
- -DASSERT=OFF \
- -DCINTEGRATION=%{?with_cintegration:ON}%{!?with_cintegration:OFF} \
- -DFITS=%{?with_fits:ON}%{!?with_fits:OFF} \
- -DGEOM=%{?with_geos:ON}%{!?with_geos:OFF} \
- -DINT128=%{?with_hugeint:ON}%{!?with_hugeint:OFF} \
- -DNETCDF=OFF \
- -DODBC=ON \
- -DPY3INTEGRATION=%{?with_py3integration:ON}%{!?with_py3integration:OFF}
\
- -DRINTEGRATION=%{?with_rintegration:ON}%{!?with_rintegration:OFF} \
- -DSANITIZER=OFF \
- -DSHP=OFF \
- -DSTRICT=OFF \
- -DTESTING=ON \
- -DWITH_BZ2=ON \
- -DWITH_CMOCKA=OFF \
- -DWITH_CURL=ON \
- -DWITH_LZ4=ON \
- -DWITH_LZMA=ON \
- -DWITH_PCRE=ON \
- -DWITH_PROJ=OFF \
- -DWITH_READLINE=ON \
- -DWITH_SNAPPY=OFF \
- -DWITH_VALGRIND=OFF \
- -DWITH_XML2=ON \
- -DWITH_ZLIB=ON
+ -DCMAKE_INSTALL_RUNSTATEDIR=/run \
+ -DRELEASE_VERSION=ON \
+ -DASSERT=OFF \
+ -DCINTEGRATION=%{?with_cintegration:ON}%{!?with_cintegration:OFF} \
+ -DFITS=%{?with_fits:ON}%{!?with_fits:OFF} \
+ -DGEOM=%{?with_geos:ON}%{!?with_geos:OFF} \
+ -DINT128=%{?with_hugeint:ON}%{!?with_hugeint:OFF} \
+ -DNETCDF=OFF \
+ -DODBC=ON \
+
-DPY3INTEGRATION=%{?with_py3integration:ON}%{!?with_py3integration:OFF} \
+ -DRINTEGRATION=%{?with_rintegration:ON}%{!?with_rintegration:OFF} \
+ -DSANITIZER=OFF \
+ -DSHP=OFF \
+ -DSTRICT=OFF \
+ -DTESTING=ON \
+ -DWITH_BZ2=ON \
+ -DWITH_CMOCKA=OFF \
+ -DWITH_CURL=ON \
+ -DWITH_LZ4=ON \
+ -DWITH_LZMA=ON \
+ -DWITH_PCRE=ON \
+ -DWITH_PROJ=OFF \
+ -DWITH_READLINE=ON \
+ -DWITH_SNAPPY=OFF \
+ -DWITH_VALGRIND=OFF \
+ -DWITH_XML2=ON \
+ -DWITH_ZLIB=ON
%cmake3_build
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -3785,48 +3785,35 @@ BBPsync(int cnt, bat *restrict subcommit
ret = BBPprepare(subcommit != NULL);
/* PHASE 1: safeguard everything in a backup-dir */
- if (ret == GDK_SUCCEED) {
- int idx = 0;
-
- while (++idx < cnt) {
- bat i = subcommit ? subcommit[idx] : idx;
- const bat bid = i;
+ for (int idx = 1; ret == GDK_SUCCEED && idx < cnt; idx++) {
+ bat i = subcommit ? subcommit[idx] : idx;
+ const bat bid = i;
+ if (lock)
+ MT_lock_set(&GDKswapLock(bid));
+ /* set flag that we're syncing, i.e. that we'll
+ * be between moving heap to backup dir and
+ * saving the new version, in other words, the
+ * heap may not exist in the usual location */
+ BBP_status_on(bid, BBPSYNCING);
+ /* wait until unloading is finished before
+ * attempting to make a backup */
+ while (BBP_status(bid) & BBPUNLOADING) {
+ if (lock)
+ MT_lock_unset(&GDKswapLock(bid));
+ BBPspin(bid, __func__, BBPUNLOADING);
if (lock)
MT_lock_set(&GDKswapLock(bid));
- /* set flag that we're syncing, i.e. that we'll
- * be between moving heap to backup dir and
- * saving the new version, in other words, the
- * heap may not exist in the usual location */
- BBP_status_on(bid, BBPSYNCING);
- /* wait until unloading is finished before
- * attempting to make a backup */
- while (BBP_status(bid) & BBPUNLOADING) {
- if (lock)
- MT_lock_unset(&GDKswapLock(bid));
- BBPspin(bid, __func__, BBPUNLOADING);
- if (lock)
- MT_lock_set(&GDKswapLock(bid));
- }
- BAT *b = dirty_bat(&i, subcommit != NULL);
- if (i <= 0) {
- if (lock)
- MT_lock_unset(&GDKswapLock(bid));
- break;
- }
- if (BBP_status(bid) & BBPEXISTING) {
- if (b != NULL && b->batInserted > 0) {
- if (BBPbackup(b, subcommit != NULL) !=
GDK_SUCCEED) {
- if (lock)
-
MT_lock_unset(&GDKswapLock(bid));
- break;
- }
- }
- }
- if (lock)
- MT_lock_unset(&GDKswapLock(bid));
}
- if (idx < cnt)
+ BAT *b = dirty_bat(&i, subcommit != NULL);
+ if (i <= 0 ||
+ (BBP_status(bid) & BBPEXISTING &&
+ b != NULL &&
+ b->batInserted > 0 &&
+ BBPbackup(b, subcommit != NULL) != GDK_SUCCEED)) {
ret = GDK_FAIL;
+ }
+ if (lock)
+ MT_lock_unset(&GDKswapLock(bid));
}
TRC_DEBUG(PERF, "move time "LLFMT" usec, %d files\n", (t1 = GDKusec())
- t0, backup_files);
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2835,17 +2835,14 @@ new_logfile(logger *lg, stream* output_l
{
assert(!LOG_DISABLED(lg));
- MT_lock_set(&lg->rotation_lock);
assert(lg->flushing_output_log);
lg->flushing_output_log = false;
if (lg->id != id) {
/* lg->output_log was rotated during the flush */
assert(lg->output_log != output_log && lg->id > id);
close_stream(output_log);
- MT_lock_unset(&lg->rotation_lock);
return GDK_SUCCEED;
}
- MT_lock_unset(&lg->rotation_lock);
const lng log_large = (GDKdebug & FORCEMITOMASK)?LOG_MINI:LOG_LARGE;
@@ -2854,7 +2851,6 @@ new_logfile(logger *lg, stream* output_l
if (p == -1)
return GDK_FAIL;
if (((!lg->pending || !lg->pending->next) && lg->drops > 100000) || p >
log_large || (lg->end*1024) > log_large) {
- log_lock(lg);
if (ATOMIC_GET(&lg->refcount) == 1) {
lg->id++;
log_close_output(lg);
@@ -2865,7 +2861,6 @@ new_logfile(logger *lg, stream* output_l
// Delegate wal rotation to next writer or last flusher.
lg->request_rotation = true;
}
- log_unlock(lg);
}
return result;
}
@@ -2944,6 +2939,8 @@ number_in_flush_queue(logger *lg, unsign
static void
log_tdone(logger *lg, ulng commit_ts)
{
+ MT_lock_set(&lg->rotation_lock);
+ log_lock(lg);
if (lg->debug & 1)
fprintf(stderr, "#log_tdone " LLFMT "\n", commit_ts);
@@ -2954,6 +2951,8 @@ log_tdone(logger *lg, ulng commit_ts)
ulng id = lg->id;
if (lg->flushing_output_log && new_logfile(lg, output_log, id) !=
GDK_SUCCEED)
GDKfatal("Could not create new log file\n");
+ log_unlock(lg);
+ MT_lock_unset(&lg->rotation_lock);
}
gdk_return
diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -236,7 +236,6 @@ static FlowEvent
q_dequeue(Queue *q, Client cntxt)
{
FlowEvent r = NULL, s = NULL;
- //int i;
assert(q);
MT_sema_down(&q->s);
diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c
--- a/monetdb5/mal/mal_runtime.c
+++ b/monetdb5/mal/mal_runtime.c
@@ -281,7 +281,10 @@ runtimeProfileFinish(Client cntxt, MalBl
MT_lock_set(&mal_delayLock);
for (i = 0; i < qsize; i++) {
if (QRYqueue[i].stk == stk) {
- QRYqueue[i].status = "finished";
+ if (QRYqueue[i].status[0] == 's')
+ QRYqueue[i].status = "aborted";
+ else
+ QRYqueue[i].status = "finished";
QRYqueue[i].finished = time(0);
QRYqueue[i].workers = (int) ATOMIC_GET(&mb->workers);
/* give the MB upperbound by addition of 1 MB */
diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -1209,10 +1209,18 @@ int
exp_refers( sql_exp *p, sql_exp *c)
{
if (c->type == e_column) {
+ // at first they need to have the same expression names
if (!p->alias.name || !c->r || strcmp(p->alias.name, c->r) != 0)
return 0;
- if (c->l && ((p->alias.rname && strcmp(p->alias.rname, c->l) !=
0) || (!p->alias.rname && strcmp(p->l, c->l) != 0)))
- return 0;
+ // then compare the relation names
+ if (c->l) {
+ // if the parent has an alias for the relation name
compare with the child's relation name
+ if (p->alias.rname && strcmp(p->alias.rname, c->l) != 0)
+ return 0;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]