Changeset: 66cd2d2783e5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/66cd2d2783e5 Modified Files: MonetDB.spec gdk/gdk_bbp.c gdk/gdk_logger.c testing/sqllogictest.py Branch: default Log Message:
Merge with Sep2022 branch. diffs (truncated from 12744 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 <i...@monetdb.org> 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 @@ -3731,48 +3731,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/sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.py b/sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.test rename from sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.py rename to sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.test --- a/sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.py +++ b/sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.test @@ -1,52 +1,134 @@ -### -# Check that when a user is granted (select) access to some columns in a table, -# the user can indeed access those columns. -# In addition, check that after the access to some of the granted columns has -# been revoked, the user can access the remaining columns. -### +statement ok +CREATE schema myschema + +statement ok +CREATE USER myuser WITH UNENCRYPTED PASSWORD 'Test123' NAME 'Hulk' SCHEMA myschema + +statement ok +SET SCHEMA myschema +statement ok +CREATE TABLE test (id integer, name varchar(20), address varchar(20)) + +statement ok +INSERT INTO test (id, name,address) VALUES (1,'Tom', 'planet'),(2,'Karen', 'earth') + +# 'myuser' cannot SELECT before GRANT and after REVOKE, can SELECT after GRANT +@connection(id=tc, username=myuser, password=Test123) +statement error 42000!SELECT: access denied for myuser to table 'myschema.test' +select * from test + +statement ok +GRANT SELECT ON test TO myuser -from MonetDBtesting.sqltest import SQLTestCase +@connection(id=tc) +query ITT rowsort +select * from test +---- +1 +Tom +planet _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org