Changeset: 0422beaa0d11 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0422beaa0d11
Modified Files:
        clients/Tests/exports.stable.out
        gdk/gdk.h
        gdk/gdk_batop.c
        gdk/gdk_hash.c
        gdk/gdk_private.h
        sql/NT/dump-restore.rst
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
        sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade/Tests/upgrade.stable.out
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 183874 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -120,7 +120,6 @@ gdk_return BATextend(BAT *b, BUN newcap)
 void BATfakeCommit(BAT *b);
 gdk_return BATfirstn(BAT **topn, BAT **gids, BAT *b, BAT *cands, BAT *grps, 
BUN n, bool asc, bool nilslast, bool distinct) 
__attribute__((__warn_unused_result__));
 restrict_t BATgetaccess(BAT *b);
-PROPrec *BATgetprop(BAT *b, enum prop_t idx);
 gdk_return BATgroup(BAT **groups, BAT **extents, BAT **histo, BAT *b, BAT *s, 
BAT *g, BAT *e, BAT *h) __attribute__((__warn_unused_result__));
 const char *BATgroupaggrinit(BAT *b, BAT *g, BAT *e, BAT *s, oid *minp, oid 
*maxp, BUN *ngrpp, struct canditer *ci, BUN *ncand);
 gdk_return BATgroupavg(BAT **bnp, BAT **cntsp, BAT *b, BAT *g, BAT *e, BAT *s, 
int tp, bool skip_nils, bool abort_on_error, int scale);
@@ -168,7 +167,6 @@ BAT *BATproject(BAT *l, BAT *r);
 BAT *BATprojectchain(BAT **bats);
 gdk_return BATrangejoin(BAT **r1p, BAT **r2p, BAT *l, BAT *rl, BAT *rh, BAT 
*sl, BAT *sr, bool li, bool hi, BUN estimate) 
__attribute__((__warn_unused_result__));
 gdk_return BATreplace(BAT *b, BAT *p, BAT *n, bool force) 
__attribute__((__warn_unused_result__));
-void BATrmprop(BAT *b, enum prop_t idx);
 gdk_return BATroles(BAT *b, const char *tnme);
 BAT *BATsample(BAT *b, BUN n);
 BAT *BATsample_with_seed(BAT *b, BUN n, unsigned seed);
@@ -178,7 +176,6 @@ gdk_return BATsemijoin(BAT **r1p, BAT **
 gdk_return BATsetaccess(BAT *b, restrict_t mode);
 void BATsetcapacity(BAT *b, BUN cnt);
 void BATsetcount(BAT *b, BUN cnt);
-void BATsetprop(BAT *b, enum prop_t idx, int type, const void *v);
 BAT *BATslice(BAT *b, BUN low, BUN high);
 gdk_return BATsort(BAT **sorted, BAT **order, BAT **groups, BAT *b, BAT *o, 
BAT *g, bool reverse, bool nilslast, bool stable) 
__attribute__((__warn_unused_result__));
 gdk_return BATstr_group_concat(ValPtr res, BAT *b, BAT *s, bool skip_nils, 
bool abort_on_error, bool nil_if_empty, const char *separator);
@@ -332,7 +329,6 @@ ssize_t OIDtoStr(str *dst, size_t *len, 
 BUN ORDERfnd(BAT *b, const void *v);
 BUN ORDERfndfirst(BAT *b, const void *v);
 BUN ORDERfndlast(BAT *b, const void *v);
-void PROPdestroy(BAT *b);
 BUN SORTfnd(BAT *b, const void *v);
 BUN SORTfndfirst(BAT *b, const void *v);
 BUN SORTfndlast(BAT *b, const void *v);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2717,11 +2717,6 @@ enum prop_t {
        GDK_HASH_MASK,          /* last used hash mask */
 };
 
-gdk_export void PROPdestroy(BAT *b);
-gdk_export PROPrec *BATgetprop(BAT *b, enum prop_t idx);
-gdk_export void BATsetprop(BAT *b, enum prop_t idx, int type, const void *v);
-gdk_export void BATrmprop(BAT *b, enum prop_t idx);
-
 /*
  * @- BAT relational operators
  *
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1921,45 +1921,18 @@ PROPdestroy(BAT *b)
 }
 
 PROPrec *
-BATgetprop(BAT *b, enum prop_t idx)
+BATgetprop_nolock(BAT *b, enum prop_t idx)
 {
-       PROPrec *p = b->tprops;
+       PROPrec *p;
 
-       while (p) {
-               if (p->id == idx)
-                       return p;
+       p = b->tprops;
+       while (p && p->id != idx)
                p = p->next;
-       }
-       return NULL;
+       return p;
 }
 
-void
-BATsetprop(BAT *b, enum prop_t idx, int type, const void *v)
-{
-       PROPrec *p = BATgetprop(b, idx);
-
-       if (p == NULL) {
-               if ((p = GDKmalloc(sizeof(PROPrec))) == NULL) {
-                       /* properties are hints, so if we can't create
-                        * one we ignore the error */
-                       return;
-               }
-               p->id = idx;
-               p->next = b->tprops;
-               p->v.vtype = 0;
-               b->tprops = p;
-       } else {
-               VALclear(&p->v);
-       }
-       if (VALinit(&p->v, type, v) == NULL) {
-               /* failed to initialize, so remove property */
-               BATrmprop(b, idx);
-       }
-       b->batDirtydesc = true;
-}
-
-void
-BATrmprop(BAT *b, enum prop_t idx)
+static void
+BATrmprop_nolock(BAT *b, enum prop_t idx)
 {
        PROPrec *prop = b->tprops, *prev = NULL;
 
@@ -1978,6 +1951,63 @@ BATrmprop(BAT *b, enum prop_t idx)
        }
 }
 
+void
+BATsetprop_nolock(BAT *b, enum prop_t idx, int type, const void *v)
+{
+       PROPrec *p;
+
+       p = b->tprops;
+       while (p && p->id != idx)
+               p = p->next;
+       if (p == NULL) {
+               if ((p = GDKmalloc(sizeof(PROPrec))) == NULL) {
+                       /* properties are hints, so if we can't create
+                        * one we ignore the error */
+                       GDKclrerr();
+                       return;
+               }
+               p->id = idx;
+               p->next = b->tprops;
+               p->v.vtype = 0;
+               b->tprops = p;
+       } else {
+               VALclear(&p->v);
+       }
+       if (VALinit(&p->v, type, v) == NULL) {
+               /* failed to initialize, so remove property */
+               BATrmprop_nolock(b, idx);
+               GDKclrerr();
+       }
+       b->batDirtydesc = true;
+}
+
+PROPrec *
+BATgetprop(BAT *b, enum prop_t idx)
+{
+       PROPrec *p;
+
+       MT_lock_set(&b->batIdxLock);
+       p = BATgetprop_nolock(b, idx);
+       MT_lock_unset(&b->batIdxLock);
+       return p;
+}
+
+void
+BATsetprop(BAT *b, enum prop_t idx, int type, const void *v)
+{
+       MT_lock_set(&b->batIdxLock);
+       BATsetprop_nolock(b, idx, type, v);
+       MT_lock_unset(&b->batIdxLock);
+}
+
+void
+BATrmprop(BAT *b, enum prop_t idx)
+{
+       MT_lock_set(&b->batIdxLock);
+       BATrmprop_nolock(b, idx);
+       MT_lock_unset(&b->batIdxLock);
+}
+
 
 /*
  * The BATcount_no_nil function counts all BUN in a BAT that have a
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -228,9 +228,11 @@ BATcheckhash(BAT *b)
                                                close(fd);
                                                h->heap.parentid = 
b->batCacheid;
                                                h->heap.dirty = false;
-                                               BATsetprop(b, GDK_HASH_MASK,
-                                                          TYPE_oid,
-                                                          &(oid){h->mask + 1});
+                                               BATsetprop_nolock(
+                                                       b,
+                                                       GDK_HASH_MASK,
+                                                       TYPE_oid,
+                                                       &(oid){h->mask + 1});
                                                b->thash = h;
                                                ACCELDEBUG fprintf(stderr, 
"#BATcheckhash: reusing persisted hash %s\n", BATgetId(b));
                                                MT_lock_unset(&b->batIdxLock);
@@ -400,7 +402,7 @@ BAThash_impl(BAT *b, BAT *s, const char 
                /* if key, or if small, don't bother dynamically
                 * adjusting the hash mask */
                mask = HASHmask(cnt);
-       } else if (s == NULL && (prop = BATgetprop(b, GDK_HASH_MASK)) != NULL) {
+       } else if (s == NULL && (prop = BATgetprop_nolock(b, GDK_HASH_MASK)) != 
NULL) {
                assert(prop->v.vtype == TYPE_oid);
                mask = prop->v.val.oval;
                assert((mask & (mask - 1)) == 0); /* power of two */
@@ -532,7 +534,7 @@ BAThash_impl(BAT *b, BAT *s, const char 
                break;
        }
        if (s == NULL)
-               BATsetprop(b, GDK_HASH_MASK, TYPE_oid, &(oid){h->mask + 1});
+               BATsetprop_nolock(b, GDK_HASH_MASK, TYPE_oid, &(oid){h->mask + 
1});
        ((size_t *) h->heap.base)[5] = (size_t) nslots;
 #ifndef NDEBUG
        /* clear unused part of Link array */
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -60,6 +60,10 @@ enum heaptype {
        __attribute__((__visibility__("hidden")));
 __hidden void BATfree(BAT *b)
        __attribute__((__visibility__("hidden")));
+__hidden PROPrec *BATgetprop(BAT *b, enum prop_t idx)
+       __attribute__((__visibility__("hidden")));
+__hidden PROPrec * BATgetprop_nolock(BAT *b, enum prop_t idx)
+       __attribute__((__visibility__("hidden")));
 __hidden gdk_return BATgroup_internal(BAT **groups, BAT **extents, BAT 
**histo, BAT *b, BAT *s, BAT *g, BAT *e, BAT *h, bool subsorted)
        __attribute__((__warn_unused_result__))
        __attribute__((__visibility__("hidden")));
@@ -72,8 +76,14 @@ enum heaptype {
 __hidden gdk_return BATmaterialize(BAT *b)
        __attribute__((__warn_unused_result__))
        __attribute__((__visibility__("hidden")));
+__hidden void BATrmprop(BAT *b, enum prop_t idx)
+       __attribute__((__visibility__("hidden")));
 __hidden void BATsetdims(BAT *b)
        __attribute__((__visibility__("hidden")));
+__hidden void BATsetprop(BAT *b, enum prop_t idx, int type, const void *v)
+       __attribute__((__visibility__("hidden")));
+__hidden void BATsetprop_nolock(BAT *b, enum prop_t idx, int type, const void 
*v)
+       __attribute__((__visibility__("hidden")));
 __hidden gdk_return BBPcacheit(BAT *bn, bool lock)
        __attribute__((__warn_unused_result__))
        __attribute__((__visibility__("hidden")));
@@ -210,6 +220,8 @@ void IMPSprint(BAT *b)              /* never called:
        __attribute__((__visibility__("hidden")));
 __hidden void persistOIDX(BAT *b)
        __attribute__((__visibility__("hidden")));
+__hidden void PROPdestroy(BAT *b)
+       __attribute__((__visibility__("hidden")));
 __hidden gdk_return rangejoin(BAT *r1, BAT *r2, BAT *l, BAT *rl, BAT *rh, BAT 
*sl, BAT *sr, bool li, bool hi, BUN maxsize)
        __attribute__((__warn_unused_result__))
        __attribute__((__visibility__("hidden")));
diff --git a/sql/NT/dump-restore.rst b/sql/NT/dump-restore.rst
--- a/sql/NT/dump-restore.rst
+++ b/sql/NT/dump-restore.rst
@@ -4,14 +4,16 @@
 ..
 .. Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
-Dumping the SQL database
-------------------------
+Dumping a MonetDB SQL database
+------------------------------
 
-Start the SQL Server and SQL Client as usual.
+Start MonetDB Server (msqlserver.bat) and MonetDB Client (mclient.bat)
+as usual.
 
-In the SQL Client, type the following three commands.  Type them
-without any extra white space::
+In the mclient shell, type the following three commands.  Type them
+without any extra white space:
 
+::
        >.../dump.sql
        \D
        >
@@ -25,30 +27,32 @@ file.  And finally a line with just a gr
 closes the file and redirects the output again to the screen.
 
 [Note: if you don't use the absolute path name of a file, the file
-will be created in the directory where the SQL Client was started.  On
+will be created in the directory where the mclient was started.  On
 Windows this is at the location where the program was installed, and
 therefore using an absolute path name is highly recommended.]
 
-It is also possible to dump from the command line.  Start a SQL
-Server, and then issue the command
+It is also possible to dump from the command line.  Start a MonetDB
+Server, and then issue the command:
 
 ::
-       msqldump -umonetdb > dump.sql
+       msqldump.bat -umonetdb > dump.sql
 
 You will need to provide the password (monetdb).
 
-This command will connect to the SQL Server and dump the database into
-the file dump.sql in the current directory.
+This command will connect to the MonetDB Server and dump the database
+into the file dump.sql in the current directory.
 
-Restoring the SQL database
---------------------------
+
+Restoring a MonetDB SQL database
+--------------------------------
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to