Changeset: c666de836f29 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c666de836f29
Branch: monetdburl
Log Message:

Merge 'default' into 'monetdburl'


diffs (truncated from 374 to 300 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -3,7 +3,6 @@ name: MonetDB build and test
 on:
   push:
     branches: 
-      - '*'
       - 'branches/*'
   pull_request:
   # Allows you to run this workflow manually from the Actions tab
@@ -30,7 +29,8 @@ jobs:
         run: |
           mkdir build
           cd build 
-          cmake ..  -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.branch }} 
-DPY3INTEGRATION=OFF -DCMAKE_BUILD_TYPE=Release -DASSERT=OFF -DRINTEGRATION=OFF
+          cmake ..  -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.branch }} 
-DPY3INTEGRATION=OFF -DCMAKE_BUILD_TYPE=Release -DASSERT=OFF -DRINTEGRATION=OFF 
\
+            -DCMAKE_SUMMARY=ON
           make install -j3
         if: runner.os == 'Linux'
       -
@@ -42,16 +42,25 @@ jobs:
           mkdir build
           cd build 
           cmake ..  -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.branch }} 
-DPY3INTEGRATION=OFF -DCMAKE_BUILD_TYPE=Release -DASSERT=OFF -DRINTEGRATION=OFF 
 \
-            -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
+            -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison 
-DCMAKE_SUMMARY=ON
           make install -j3
         if: runner.os == 'macOS'
       - name: ctest 
         run: |
           cd build 
           cmake --build . --target test
-          #-
-          #uses: actions/upload-artifact@v3
-          #name: Publish Linux binary wheels
-          #with:
-          #name: monetdbe-linux-wheel-${{ matrix.branch }}-${{ 
matrix.python-version }}
-          #path: dist/*.whl
+      - name: install pymonetdb
+        run: pip3 install pymonetdb
+      - name: which python
+        run: 
+          head -n 1 $HOME/${{ matrix.branch }}/bin/Mtest.py 
+      - name: mtest 
+        run: |
+          #cd build 
+          #cmake --build . --target mtest
+          PATH=$HOME/${{ matrix.branch }}/bin:$PATH $HOME/${{ matrix.branch 
}}/bin/Mtest.py -r --debug=0 --ci
+      - name: Publish mtest results
+        uses: actions/upload-artifact@v3
+        with:
+          name: mtest-${{ matrix.branch }}
+          path: ${{ matrix.branch }}/mTests/*
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
@@ -1208,7 +1208,7 @@ const char *replaceRef;
 void resetMalBlk(MalBlkPtr mb);
 void resetMalTypes(MalBlkPtr mb, int stop);
 int resizeMalBlk(MalBlkPtr mb, int elements);
-int resolveType(int dsttype, int srctype);
+int resolvedType(int dsttype, int srctype);
 const char *resultSetRef;
 const char *revokeRef;
 const char *revoke_functionRef;
diff --git a/common/stream/Tests/read_tests.py 
b/common/stream/Tests/read_tests.py
--- a/common/stream/Tests/read_tests.py
+++ b/common/stream/Tests/read_tests.py
@@ -148,4 +148,3 @@ if __name__ == "__main__":
     else:
         print("Usage: python3 read_tests.py [TESTDATANAME]", file=sys.stderr)
         sys.exit(1)
-
diff --git a/common/stream/Tests/testdata.py b/common/stream/Tests/testdata.py
--- a/common/stream/Tests/testdata.py
+++ b/common/stream/Tests/testdata.py
@@ -216,6 +216,7 @@ class TestFile:
         else:
             raise Exception("Unknown compression scheme: " + self.compression)
         f.write(content)
+        f.close()
         return filename
 
 
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1642,11 +1642,23 @@ cleanup_and_swap(logger *lg, int *r, con
        lg->catalog_id = noids;
        lg->dcatalog = ndels;
 
+       /* failing to rename these two bats is not fatal */
+       if (BBPrename(lg->catalog_cnt, NULL) != GDK_SUCCEED)
+               GDKclrerr();
+       if (BBPrename(lg->catalog_lid, NULL) != GDK_SUCCEED)
+               GDKclrerr();
        BBPunfix(lg->catalog_cnt->batCacheid);
        BBPunfix(lg->catalog_lid->batCacheid);
 
        lg->catalog_cnt = ncnts;
        lg->catalog_lid = nlids;
+       char bak[FILENAME_MAX];
+       strconcat_len(bak, sizeof(bak), lg->fn, "_catalog_cnt", NULL);
+       if (BBPrename(lg->catalog_cnt, bak) < 0)
+               GDKclrerr();
+       strconcat_len(bak, sizeof(bak), lg->fn, "_catalog_lid", NULL);
+       if (BBPrename(lg->catalog_lid, bak) < 0)
+               GDKclrerr();
        lg->cnt = BATcount(lg->catalog_bid);
        lg->deleted -= cleanup;
        return rcnt;
@@ -2061,16 +2073,24 @@ log_load(const char *fn, const char *log
                BBPretain(lg->catalog_id->batCacheid);
                BBPretain(lg->dcatalog->batCacheid);
        }
+       /* failing to rename the catalog_cnt and catalog_lid bats is not
+        * fatal */
        lg->catalog_cnt = logbat_new(TYPE_lng, 1, SYSTRANS);
        if (lg->catalog_cnt == NULL) {
                GDKerror("failed to create catalog_cnt bat");
                goto error;
        }
+       strconcat_len(bak, sizeof(bak), fn, "_catalog_cnt", NULL);
+       if (BBPrename(lg->catalog_cnt, bak) < 0)
+               GDKclrerr();
        lg->catalog_lid = logbat_new(TYPE_lng, 1, SYSTRANS);
        if (lg->catalog_lid == NULL) {
                GDKerror("failed to create catalog_lid bat");
                goto error;
        }
+       strconcat_len(bak, sizeof(bak), fn, "_catalog_lid", NULL);
+       if (BBPrename(lg->catalog_lid, bak) < 0)
+               GDKclrerr();
        if (bm_get_counts(lg) != GDK_SUCCEED)
                goto error;
 
diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c
--- a/monetdb5/mal/mal_function.c
+++ b/monetdb5/mal/mal_function.c
@@ -198,8 +198,7 @@ chkFlow(MalBlkPtr mb)
                                          getModuleId(sig), getFunctionId(sig));
                        } else if (ps->typechk == TYPE_RESOLVED)
                                for (e = 0; e < p->retc; e++) {
-                                       if (resolveType(getArgType(mb, ps, e), 
getArgType(mb, p, e))
-                                               < 0) {
+                                       if (resolvedType(getArgType(mb, ps, e), 
getArgType(mb, p, e)) < 0) {
                                                str tpname = 
getTypeName(getArgType(mb, p, e));
                                                msg = createException(MAL,
                                                                                
          "%s.%s RETURN type mismatch at type '%s'\n",
diff --git a/monetdb5/mal/mal_resolve.c b/monetdb5/mal/mal_resolve.c
--- a/monetdb5/mal/mal_resolve.c
+++ b/monetdb5/mal/mal_resolve.c
@@ -27,6 +27,68 @@ static malType getPolyType(malType t, in
 static int updateTypeMap(int formal, int actual, int polytype[MAXTYPEVAR]);
 static int typeKind(MalBlkPtr mb, InstrPtr p, int i);
 
+int
+resolvedType(int dsttype, int srctype)
+{
+       if (dsttype == srctype || dsttype == TYPE_any || srctype == TYPE_any ||
+       (isaBatType(srctype) && dsttype == TYPE_bat) ||
+          (isaBatType(dsttype) && srctype == TYPE_bat))
+               return 0;
+
+       if (isaBatType(dsttype) && isaBatType(srctype)) {
+               int t1 = getBatType(dsttype);
+               int t2 = getBatType(srctype);
+               if (t1 == t2 || t1 == TYPE_any || t2 == TYPE_any)
+                       return 0;
+       }
+       return -1;
+}
+
+static int
+resolveType(int *rtype, int dsttype, int srctype)
+{
+       if (dsttype == srctype) {
+               *rtype = dsttype;
+               return 0;
+       }
+       if (dsttype == TYPE_any) {
+               *rtype = srctype;
+               return 0;
+       }
+       if (srctype == TYPE_any) {
+               *rtype = dsttype;
+               return 0;
+       }
+       /*
+        * A bat reference can be coerced to bat type.
+        */
+       if (isaBatType(srctype) && dsttype == TYPE_bat) {
+               *rtype = srctype;
+               return 0;
+       }
+       if (isaBatType(dsttype) && srctype == TYPE_bat) {
+               *rtype = dsttype;
+               return 0;
+       }
+       if (isaBatType(dsttype) && isaBatType(srctype)) {
+               int t1, t2, t3;
+               t1 = getBatType(dsttype);
+               t2 = getBatType(srctype);
+               if (t1 == t2)
+                       t3 = t1;
+               else if (t1 == TYPE_any)
+                       t3 = t2;
+               else if (t2 == TYPE_any)
+                       t3 = t1;
+               else {
+                       return -1;
+               }
+               *rtype = newBatType(t3);
+               return 0;
+       }
+       return -1;
+}
+
 
 /*
  * Since we now know the storage type of the receiving variable, we can
@@ -174,7 +236,7 @@ findFunctionType(Module scope, MalBlkPtr
                                 * If it fails, we know this isn't the function 
we are
                                 * looking for.
                                 */
-                               if (resolveType(formal, actual) == -1) {
+                               if (resolvedType(formal, actual) < 0) {
                                        unmatched = i;
                                        break;
                                }
@@ -203,7 +265,7 @@ findFunctionType(Module scope, MalBlkPtr
                                                formal = getPolyType(formal, 
polytype);
                                                if (formal == actual || formal 
== TYPE_any)
                                                        continue;
-                                               if (resolveType(formal, actual) 
== -1) {
+                                               if (resolvedType(formal, 
actual) < 0) {
                                                        unmatched = i;
                                                        break;
                                                }
@@ -224,7 +286,7 @@ findFunctionType(Module scope, MalBlkPtr
                        for (i = p->retc; i < p->argc; i++) {
                                int actual = getArgType(mb, p, i);
                                int formal = getArgType(s->def, sig, i);
-                               if (resolveType(formal, actual) == -1) {
+                               if (resolvedType(formal, actual) < 0) {
                                        unmatched = i;
                                        break;
                                }
@@ -265,8 +327,7 @@ findFunctionType(Module scope, MalBlkPtr
 
                                s1 = getPolyType(formal, polytype);
 
-                               returntype[i] = resolveType(s1, actual);
-                               if (returntype[i] == -1) {
+                               if (resolveType(returntype+i, s1, actual) < 0) {
                                        s1 = -1;
                                        break;
                                }
@@ -282,8 +343,7 @@ findFunctionType(Module scope, MalBlkPtr
                                if (actual == formal)
                                        returntype[i] = actual;
                                else {
-                                       returntype[i] = resolveType(formal, 
actual);
-                                       if (returntype[i] == -1) {
+                                       if (resolveType(returntype+i, formal, 
actual) < 0) {
                                                s1 = -1;
                                                break;
                                        }
@@ -425,40 +485,6 @@ findFunctionType(Module scope, MalBlkPtr
        return -3;
 }
 
-int
-resolveType(int dsttype, int srctype)
-{
-       if (dsttype == srctype)
-               return dsttype;
-       if (dsttype == TYPE_any)
-               return srctype;
-       if (srctype == TYPE_any)
-               return dsttype;
-       /*
-        * A bat reference can be coerced to bat type.
-        */
-       if (isaBatType(srctype) && dsttype == TYPE_bat)
-               return srctype;
-       if (isaBatType(dsttype) && srctype == TYPE_bat)
-               return dsttype;
-       if (isaBatType(dsttype) && isaBatType(srctype)) {
-               int t1, t2, t3;
-               t1 = getBatType(dsttype);
-               t2 = getBatType(srctype);
-               if (t1 == t2)
-                       t3 = t1;
-               else if (t1 == TYPE_any)
-                       t3 = t2;
-               else if (t2 == TYPE_any)
-                       t3 = t1;
-               else {
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to