Changeset: aad96fbaf536 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/aad96fbaf536
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/include/sql_catalog.h
        sql/server/rel_schema.c
        sql/server/sql_mvc.c
        sql/storage/sql_storage.h
        sql/storage/store.c
Branch: check
Log Message:

merge with default


diffs (truncated from 2471 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -25330,122 +25330,62 @@ SQLvar_pop;
 return the variance population of groups
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat[:bte]):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat[:dbl]):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat?[:bte]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat[:flt]):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat[:int]):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat[:lng]):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat?[:dbl]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat[:sht]):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bte):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat?[:flt]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:dbl):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat?[:int]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:flt):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:int):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:lng):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat?[:lng]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:sht):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat[:bte]):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, 
X_4:bat?[:sht]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat[:dbl]):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat?[:bte]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat[:flt]):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat[:int]):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat[:lng]):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat?[:dbl]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat[:sht]):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bte):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:dbl):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat?[:flt]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:flt):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat?[:int]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:int):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat?[:lng]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batsql
 window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:lng):bat[:oid]
-SQLwindow_bound;
-computes window ranges for each row
-batsql
-window_bound
-pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:sht):bat[:oid]
+pattern batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, 
X_4:int, X_5:bat?[:sht]):bat[:oid]
 SQLwindow_bound;
 computes window ranges for each row
 batstr
@@ -37445,7 +37385,7 @@ mvc_clear_table_wrap;
 Clear the table sname.tname.
 sql
 copy_from
-unsafe pattern sql.copy_from(X_0:ptr, X_1:str, X_2:str, X_3:str, X_4:str, 
X_5:str, X_6:lng, X_7:lng, X_8:int, X_9:str, X_10:int, X_11:int):bat[:any]...
+unsafe pattern sql.copy_from(X_0:ptr, X_1:str, X_2:str, X_3:str, X_4:str, 
X_5:str, X_6:lng, X_7:lng, X_8:int, X_9:str, X_10:int, X_11:int, X_12:str, 
X_13:str):bat[:any]...
 mvc_import_table_wrap;
 Import a table from bstream s with the @given tuple and seperators (sep/rsep)
 sql
diff --git a/clients/odbc/tests/ODBCmetadata.c 
b/clients/odbc/tests/ODBCmetadata.c
--- a/clients/odbc/tests/ODBCmetadata.c
+++ b/clients/odbc/tests/ODBCmetadata.c
@@ -186,6 +186,11 @@ compareResultOptClose(SQLHANDLE stmt, SQ
        check(ret, SQL_HANDLE_STMT, stmt, "SQLRowCount()");
        pos += snprintf(outp + pos, outp_len - pos, "Resultset with %"PRId64" 
rows\n", (int64_t) rows);
 
+       /* detect if special handling of data returned by second TRACE 
resultset is needed */
+       if (columns == 2 && (strncmp("TRACE(2) ", functionname, 9) == 0)) {
+               replaceTraceData = 1;
+       }
+
        /* get Result Column Names and print them */
        for (col = 1; col <= columns; col++) {
                ret = SQLDescribeCol(stmt, col, (SQLCHAR *) buf, sizeof(buf),
@@ -214,7 +219,7 @@ compareResultOptClose(SQLHANDLE stmt, SQ
                case SQL_BINARY:
                case SQL_VARBINARY:
                case SQL_LONGVARBINARY:
-                       if (columnSize != 0) {
+                       if (columnSize != 0 && replaceTraceData == 0) {
                                if (decimalDigits != 0) {
                                        pos += snprintf(outp + pos, outp_len - 
pos,
                                                "(%d,%d)", (int) columnSize, 
(int) decimalDigits);
@@ -239,11 +244,6 @@ compareResultOptClose(SQLHANDLE stmt, SQ
                }
        }
 
-       /* detect if special handling of data returned by second TRACE 
resultset is needed */
-       if (columns == 2 && (strncmp("TRACE(2) ", functionname, 9) == 0)) {
-               replaceTraceData = 1;
-       }
-
        /* Loop through the rows in the result-set */
        ret = SQLFetch(stmt);
        check(ret, SQL_HANDLE_STMT, stmt, "SQLFetch(1)");
@@ -1594,7 +1594,7 @@ main(int argc, char **argv)
                        "Resultset with 2 columns\n"
                        "Resultset with 12 rows\n"
                        "usec   statement\n"
-                       "BIGINT WVARCHAR(249)\n"
+                       "BIGINT WVARCHAR\n"
                        "4      variable output\n"
                        "4      variable output\n"
                        "4      variable output\n"
@@ -1611,7 +1611,7 @@ main(int argc, char **argv)
                        "Resultset with 2 columns\n"
                        "Resultset with 11 rows\n"
                        "usec   statement\n"
-                       "BIGINT WVARCHAR(240)\n"
+                       "BIGINT WVARCHAR\n"
                        "4      variable output\n"
                        "4      variable output\n"
                        "4      variable output\n"
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -887,9 +887,6 @@ mskGetVal(BAT *b, BUN p)
  * @item int
  * @tab
  *  HEAPcopy (Heap *dst,*src);
- * @item int
- * @tab
- *  HEAPwarm (Heap *h);
  * @end multitable
  *
  *
@@ -1132,6 +1129,17 @@ bat_iterator_nolock(BAT *b)
        return (BATiter) {0};
 }
 
+static inline void
+bat_iterator_incref(BATiter *bi)
+{
+#ifndef NDEBUG
+       bi->locked = true;
+#endif
+       HEAPincref(bi->h);
+       if (bi->vh)
+               HEAPincref(bi->vh);
+}
+
 static inline BATiter
 bat_iterator(BAT *b)
 {
@@ -1158,12 +1166,7 @@ bat_iterator(BAT *b)
                        MT_lock_set(&pvb->theaplock);
                }
                bi = bat_iterator_nolock(b);
-#ifndef NDEBUG
-               bi.locked = true;
-#endif
-               HEAPincref(bi.h);
-               if (bi.vh)
-                       HEAPincref(bi.vh);
+               bat_iterator_incref(&bi);
                if (pvb)
                        MT_lock_unset(&pvb->theaplock);
                if (pb)
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -822,12 +822,7 @@ COLcopy(BAT *b, int tt, bool writable, r
        if (ATOMstorage(b->ttype) == TYPE_str && b->tvheap->free >= 
GDK_STRHASHSIZE)
                memcpy(strhash, b->tvheap->base, GDK_STRHASHSIZE);
 
-#ifndef NDEBUG
-       bi.locked = true;
-#endif
-       HEAPincref(bi.h);
-       if (bi.vh)
-               HEAPincref(bi.vh);
+       bat_iterator_incref(&bi);
        MT_lock_unset(&b->theaplock);
 
        /* first try case (1); create a view, possibly with different
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -665,7 +665,7 @@ append_msk_bat(BAT *b, BATiter *ni, stru
 /* Append the contents of BAT n (subject to the optional candidate
  * list s) to BAT b.  If b is empty, b will get the seqbase of s if it
  * was passed in, and else the seqbase of n. */
-gdk_return
+static gdk_return
 BATappend2(BAT *b, BAT *n, BAT *s, bool force, bool mayshare)
 {
        struct canditer ci;
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -2464,7 +2464,8 @@ BBPdir_step(bat bid, BUN size, int n, ch
                        }
                }
        }
-       if (BBP_status(bid) & BBPPERSISTENT) {
+       if (bi) {
+               assert(BBP_status(bid) & BBPPERSISTENT);
                if (new_bbpentry(nbbpf, bid, size, bi) != GDK_SUCCEED)
                        goto bailout;
        }
@@ -3871,12 +3872,7 @@ BBPbackup(BAT *b, bool subcommit)
                bi.h = b->oldtail;
                bi.hdirty = b->oldtail->dirty;
        }
-#ifndef NDEBUG
-       bi.locked = true;
-#endif
-       HEAPincref(bi.h);
-       if (bi.vh)
-               HEAPincref(bi.vh);
+       bat_iterator_incref(&bi);
        MT_lock_unset(&b->theaplock);
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to