Changeset: b460ee6a1a41 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b460ee6a1a41
Modified Files:
        gdk/gdk_select.c
        sql/storage/store.c
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (266 lines):

diff --git a/documentation/source/manual_pages/mclient.rst 
b/documentation/source/manual_pages/mclient.rst
--- a/documentation/source/manual_pages/mclient.rst
+++ b/documentation/source/manual_pages/mclient.rst
@@ -52,6 +52,9 @@ for *mclient* to mal looks like this: **
 reading the *.monetdb* file, set the variable **DOTMONETDBFILE** to the
 empty string in the environment.
 
+When working interactively, an interrupt (usually control-C) will clear
+any query being edited and will stop any running query.
+
 OPTIONS
 =======
 
diff --git a/documentation/source/manual_pages/mserver5.rst.in 
b/documentation/source/manual_pages/mserver5.rst.in
--- a/documentation/source/manual_pages/mserver5.rst.in
+++ b/documentation/source/manual_pages/mserver5.rst.in
@@ -84,6 +84,12 @@ MSERVER5 OPTIONS
    file) which should be located in the lib/monetdb5 directory. This
    option can be repeated for different modules.
 
+**--without-geom**
+   Start the server without *geom* support, even if it is available.
+   Normally the server will refuse to start if *geom* is loaded, but the
+   database was created by a server without *geom* support. With this
+   option it is possible to start the server anyway.
+
 **--help**
    Print list of options.
 
diff --git a/documentation/source/manual_pages/msqldump.rst 
b/documentation/source/manual_pages/msqldump.rst
--- a/documentation/source/manual_pages/msqldump.rst
+++ b/documentation/source/manual_pages/msqldump.rst
@@ -73,8 +73,32 @@ OPTIONS
 **--functions** (**-f**)
    Only dump functions definitions.
 
-**--table=**\ *table* (**-t** *table*)
-   Only dump the specified *table*.
+**--table=**\ [\ *schema*\ **.**\ ]\ *table* (**-t** [\ *schema*\ **.**]\ 
*table*\ )
+   Only dump the specified table. If *schema* is not specified, the
+   user's current schema is used. When either *schema* or *table*
+   contains percent characters, all tables matching the (SQL) search
+   pattern are dumped.
+
+**--output=**\ *filename* (**-o** *filename*\ )
+   Write the dump to the specified file. If *filename* contains a
+   recognized compression scheme suffix, the file will be compressed
+   using that scheme.
+
+**--outputdir=**\ *directory* (**-O** *directory*\ )
+   Write the dump to the file **dump.sql** in the specified directory
+   which is created if it does not exist. The data of the tables will be
+   stored in separate CSV files in the directory. If the
+   **--compression** option is used, the CSV files will be compressed
+   using the specified compression scheme. If both the **--outputdir**
+   option and the **--output** option are specified, the last one is
+   used. The **--outputdir** option is not compatible with the --inserts
+   option.
+
+**--compression=**\ *extension* (**-x** *extension*\ )
+   Compress the CSV files produced with the **--outputdir** option using
+   the specified compression scheme. Depending on how the program is
+   compiled, the following compression schemes are recognized: **gz**,
+   **bz2**, **xz**, and **lz4**.
 
 **--quiet** (**-q**)
    Don't print the welcome message.
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -140,9 +140,8 @@
 
 #define GETBIN(Z,X,B)                          \
        do {                                    \
-               int _i;                         \
                Z = 0;                          \
-               for (_i = 1; _i < B; _i++)      \
+               for (int _i = 1; _i < B; _i++)  \
                        Z += ((X) >= bins[_i]); \
        } while (0)
 
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -110,6 +110,7 @@ hashselect(BATiter *bi, struct canditer 
        oid seq;
        int (*cmp)(const void *, const void *);
        BAT *b2 = NULL;
+       BATiter pbi = {0};
 
        size_t counter = 0;
        QryCtx *qry_ctx = MT_thread_get_qry_ctx();
@@ -130,14 +131,18 @@ hashselect(BATiter *bi, struct canditer 
                d = bi->baseoff - b2->tbaseoff;
                l += d;
                h += d;
-               bat_iterator_end(bi);
-               *bi = bat_iterator(b2);
+               pbi = bat_iterator(b2);
+               bi = &pbi;
+       } else {
+               phash = false;
        }
 
        if (!havehash) {
                if (BAThash(bi->b) != GDK_SUCCEED) {
                        BBPreclaim(bn);
                        BBPreclaim(b2);
+                       if (phash)
+                               bat_iterator_end(&pbi);
                        return NULL;
                }
                MT_rwlock_rdlock(&bi->b->thashlock);
@@ -200,10 +205,14 @@ hashselect(BATiter *bi, struct canditer 
        bn->tsorted = true;
        bn->trevsorted = bn->batCount <= 1;
        bn->tseqbase = bn->batCount == 0 ? 0 : bn->batCount == 1 ? *dst : 
oid_nil;
+       if (phash)
+               bat_iterator_end(&pbi);
        return bn;
 
   bailout:
        MT_rwlock_rdunlock(&bi->b->thashlock);
+       if (phash)
+               bat_iterator_end(&pbi);
        BBPreclaim(b2);
        BBPreclaim(bn);
        return NULL;
@@ -339,8 +348,8 @@ quickins(oid *dst, BUN cnt, oid o, BAT *
                const uint##B##_t *restrict im = (uint##B##_t *) 
imprints->imps; \
                uint##B##_t mask = 0, innermask;                        \
                const int tpe = ATOMbasetype(bi->type);                 \
-               const int lbin = IMPSgetbin(tpe, imprints->bits, 
imprints->bins, tl); \
-               const int hbin = IMPSgetbin(tpe, imprints->bits, 
imprints->bins, th); \
+               const int lbin = IMPSgetbin(tpe, imprints->bits, 
imprints->bins, &vl); \
+               const int hbin = IMPSgetbin(tpe, imprints->bits, 
imprints->bins, &vh); \
                /* note: (1<<n)-1 gives a sequence of n one bits */     \
                /* to set bits hbin..lbin inclusive, we would do: */    \
                /* mask = ((1 << (hbin + 1)) - 1) - ((1 << lbin) - 1); */ \
@@ -380,9 +389,13 @@ quickins(oid *dst, BUN cnt, oid o, BAT *
                for (BUN ii = 0; ii < B; ii++) {                        \
                        if (is_##TYPE##_nil(imp_min) && imp_cnt[ii]) {  \
                                imp_min = basesrc[imprints->stats[ii]]; \
+                               break;                                  \
                        }                                               \
-                       if (is_##TYPE##_nil(imp_max) && imp_cnt[B-1-ii]) { \
-                               imp_max = basesrc[imprints->stats[64+B-1-ii]]; \
+               }                                                       \
+               for (BUN ii = B; ii != 0; ii--) {                       \
+                       if (is_##TYPE##_nil(imp_max) && imp_cnt[ii-1]) { \
+                               imp_max = basesrc[imprints->stats[64+ii-1]]; \
+                               break;                                  \
                        }                                               \
                }                                                       \
                assert(!is_##TYPE##_nil(imp_min) &&                     \
@@ -2323,16 +2336,12 @@ BATselect(BAT *b, BAT *s, const void *tl
                                imprints = pb->timprints;
                                if (imprints != NULL)
                                        IMPSincref(imprints);
-                               else
-                                       imprints = NULL;
                                MT_lock_unset(&pb->batIdxLock);
                        } else {
                                MT_lock_set(&b->batIdxLock);
                                imprints = b->timprints;
                                if (imprints != NULL)
                                        IMPSincref(imprints);
-                               else
-                                       imprints = NULL;
                                MT_lock_unset(&b->batIdxLock);
                        }
                }
@@ -2705,16 +2714,12 @@ rangejoin(BAT *r1, BAT *r2, BAT *l, BAT 
                        imprints = tmp->timprints;
                        if (imprints != NULL)
                                IMPSincref(imprints);
-                       else
-                               imprints = NULL;
                        MT_lock_unset(&tmp->batIdxLock);
                } else {
                        MT_lock_set(&l->batIdxLock);
                        imprints = l->timprints;
                        if (imprints != NULL)
                                IMPSincref(imprints);
-                       else
-                               imprints = NULL;
                        MT_lock_unset(&l->batIdxLock);
                }
                /* in the unlikely case that the imprints were removed
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -76,7 +76,7 @@ store_oldest_pending(sqlstore *store)
 static inline bool
 instore(sqlid id)
 {
-       if (id >= 2000 && id <= 2164)
+       if (id >= 2000 && id <= 2166)
                return true;
        return false;
 }
diff --git a/sql/test/remote/Tests/partition_elim.test 
b/sql/test/remote/Tests/partition_elim.test
--- a/sql/test/remote/Tests/partition_elim.test
+++ b/sql/test/remote/Tests/partition_elim.test
@@ -93,21 +93,17 @@ query R rowsort
 select y from test4 where y between 0 and -1
 ----
 
-query R rowsort
+statement ok
 analyze sys.test1
-----
 
-query R rowsort
+statement ok
 analyze sys.test2
-----
 
-query R rowsort
+statement ok
 analyze sys.test3
-----
 
-query R rowsort
+statement ok
 analyze sys.test4
-----
 
 query T python .explain.function_histogram
 explain select x,y from test where x between 4.0 and 6.0
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -408,6 +408,7 @@ class SQLLogic:
     def exec_query(self, query, columns, sorting, pyscript, hashlabel, 
nresult, hash, expected, conn=None, verbose=False) -> bool:
         err = False
         crs = conn.cursor() if conn else self.crs
+        crs.description = None
         try:
             if verbose:
                 print(f'Executing:\n{query}')
@@ -421,6 +422,10 @@ class SQLLogic:
             tpe, value, traceback = sys.exc_info()
             self.query_error(query, 'unexpected error from pymonetdb', 
str(value))
             return ['statement', 'error'], []
+        if crs.description is None:
+            # it's not a query, it's a statement
+            self.query_error(query, 'query without results')
+            return ['statement', 'ok'], []
         try:
             data = crs.fetchall()
         except KeyboardInterrupt:
@@ -906,9 +911,10 @@ class SQLLogic:
                     self.writeline(' '.join(result1))
                     for line in query:
                         self.writeline(line.rstrip(), replace=True)
-                    self.writeline('----')
-                    for line in result2:
-                        self.writeline(line)
+                    if result1[0] == 'query':
+                        self.writeline('----')
+                        for line in result2:
+                            self.writeline(line)
                 else:
                     self.writeline(qrline.rstrip())
                     for line in query:
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to