Changeset: c96fb402dcda for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c96fb402dcda
Modified Files:
        sql/server/rel_distribute.c
Branch: balanced_union
Log Message:

Merges with default


diffs (truncated from 2217 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
@@ -16,7 +16,6 @@ jobs:
     strategy:
       fail-fast: false  # don't stop other jobs
       matrix:
-        branch: [ master ]
         os: [ ubuntu-latest, macos-latest, windows-latest ]
         c_compiler: [ gcc, clang, cl ]
         include:
@@ -25,7 +24,7 @@ jobs:
           - os: macos-latest
             c_compiler: clang
           - os: macos-latest
-            c_compiler: gcc
+            c_compiler: gcc-12
           - os: ubuntu-latest
             c_compiler: gcc
           - os: ubuntu-latest
@@ -37,6 +36,8 @@ jobs:
             c_compiler: clang
           - os: macos-latest
             c_compiler: cl
+          - os: macos-latest
+            c_compiler: gcc
           - os: ubuntu-latest
             c_compiler: cl
     runs-on: ${{ matrix.os }}
@@ -44,14 +45,17 @@ jobs:
       - name: Checkout
         uses: actions/checkout@v3
         with:
-          ref: ${{ matrix.branch }}
+          ref: ${{ github.ref }}
+
+      - name: install pymonetdb cryptography
+        run: pip3 install pymonetdb cryptography
 
       - name: make MonetDB on linux
         run: |
           mkdir build
           cd build 
           cmake ..  \
-            -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.branch }} \
+            -DCMAKE_INSTALL_PREFIX=$HOME/MDB \
             -DPY3INTEGRATION=OFF \
             -DRINTEGRATION=OFF \
             -DCMAKE_BUILD_TYPE=Release \
@@ -60,16 +64,17 @@ jobs:
             -DCMAKE_SUMMARY=ON
           make install -j3
         if: runner.os == 'Linux'
-      -
-        name: brew packages
+
+      - name: brew packages
         run: brew install bison
         if: runner.os == 'macOS'
+
       - name: make MonetDB on macos
         run: |
           mkdir build
           cd build 
-          CC=${{ matrix.c_compiler }} cmake .. \
-            -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.branch }} \
+          cmake .. \
+            -DCMAKE_INSTALL_PREFIX=$HOME/MDB \
             -DPY3INTEGRATION=OFF \
             -DRINTEGRATION=OFF  \
             -DCMAKE_BUILD_TYPE=Release \
@@ -79,36 +84,52 @@ jobs:
             -DCMAKE_SUMMARY=ON
           make install -j3
         if: runner.os == 'macOS'
-      - name: make MonetDB on macos
+
+      - name: choco packages
+        run: |
+          choco install winflexbison3
+          vcpkg install libiconv bzip2 libxml2 pcre zlib getopt 
+        if: runner.os == 'Windows'
+
+      - name: make MonetDB on Windows
+        shell: pwsh
         run: |
           mkdir build
           cd build 
-          cmake .. \
-            -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.branch }} \
-            -DPY3INTEGRATION=OFF \
-            -DRINTEGRATION=OFF  \
-            -DCMAKE_BUILD_TYPE=Release \
-            -DASSERT=OFF \
-            -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-            -DCMAKE_SUMMARY=ON
-          make install -j3
+          cmake ..  -DCMAKE_INSTALL_PREFIX=C:\MDB 
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake 
-DPY3INTEGRATION=OFF -DRINTEGRATION=OFF  -DCMAKE_BUILD_TYPE=Release 
-DASSERT=OFF -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}  -DCMAKE_SUMMARY=ON
+          cmake --build . --target install
         if: runner.os == 'Windows'
+
       - name: ctest 
         run: |
           cd build 
-          cmake --build . --target test
-      - name: install pymonetdb
-        run: pip3 install pymonetdb
-      - name: which python
-        run: 
-          head -n 1 $HOME/${{ matrix.branch }}/bin/Mtest.py 
+          cmake --build . --target ${{ runner.os == 'Windows' && 'RUN_TESTS' 
|| 'test' }}
+        if: runner.os != 'Windows'
+
       - 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 --no-html
+          PATH=$HOME/MDB/bin:$PATH $HOME/MDB/bin/Mtest.py -r --debug=0 --ci 
--no-html --TSTTRGBASE=.
+        if: runner.os != 'Windows'
+
+      - name: ctest 
+        shell: pwsh
+        run: |
+          $env:PATH = 
'C:\MDB\lib;C:\MDB\lib\monetdb5;C:\MDB\bin;C:\vcpkg\installed\x64-windows\bin;C:\vcpkg\installed\x64-windows\debug\bin;'
 + $env:PATH
+          cd build 
+          cmake --build . --target ${{ runner.os == 'Windows' && 'RUN_TESTS' 
|| 'test' }}
+        if: runner.os == 'Windows'
+
+      - name: mtest 
+        shell: pwsh
+        run: |
+          $env:PATH = 
'C:\MDB\lib;C:\MDB\lib\monetdb5;C:\MDB\bin;C:\vcpkg\installed\x64-windows\bin;C:\vcpkg\installed\x64-windows\debug\bin;'
 + $env:PATH
+          python C:\MDB\bin\Mtest.py -r --debug=0 --ci --no-html --TSTTRGBASE=.
+        if: runner.os == 'Windows'
+
+      - name: Tar files
+        run: tar -cvf mtests.tar mTests
       - name: Publish mtest results
         uses: actions/upload-artifact@v3
         with:
-          name: mtest-${{ matrix.branch }}
-          path: $HOME/${{ matrix.branch }}/mTests/*
+          name: mtest-${{ github.sha }}-${{ matrix.os }}-${{ matrix.c_compiler 
}}
+          path: mtests.tar
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
@@ -730,9 +730,10 @@ msettings_error msetting_set_named(msett
 const char *msetting_string(const msettings *mp, mparm parm);
 long msettings_connect_binary(const msettings *mp);
 const char *msettings_connect_certhash_digits(const msettings *mp);
+const char *msettings_connect_clientcert(const msettings *mp);
+const char *msettings_connect_clientkey(const msettings *mp);
 long msettings_connect_port(const msettings *mp);
 bool msettings_connect_scan(const msettings *mp);
-const char *msettings_connect_sockdir(const msettings *mp);
 const char *msettings_connect_tcp(const msettings *mp);
 enum msetting_tls_verify msettings_connect_tls_verify(const msettings *mp);
 const char *msettings_connect_unix(const msettings *mp);
diff --git a/clients/examples/C/testsfile.c b/clients/examples/C/testsfile.c
--- a/clients/examples/C/testsfile.c
+++ b/clients/examples/C/testsfile.c
@@ -235,6 +235,10 @@ handle_expect_command(const char *locati
                return expect_string(location, MP_UNKNOWN, 
msettings_connect_certhash_digits, value);
        if (strcmp("connect_binary", key) == 0)
                return expect_long(location, MP_UNKNOWN, 
msettings_connect_binary, value);
+       if (strcmp("connect_clientkey", key) == 0)
+               return expect_string(location, MP_UNKNOWN, 
msettings_connect_clientkey, value);
+       if (strcmp("connect_clientcert", key) == 0)
+               return expect_string(location, MP_UNKNOWN, 
msettings_connect_clientcert, value);
 
        const mparm parm = mparm_parse(key);
        if (parm == MP_UNKNOWN) {
diff --git a/clients/mapilib/Tests/systemcertificates.py 
b/clients/mapilib/Tests/systemcertificates.py
--- a/clients/mapilib/Tests/systemcertificates.py
+++ b/clients/mapilib/Tests/systemcertificates.py
@@ -25,13 +25,20 @@ HOST = 'python.org'
 # Run mclient
 cmd = ['mclient', '-L-', '-d', f"monetdbs://{HOST}:443/demo"]
 proc = subprocess.run(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
-assert proc.returncode == 2, f"mclient is supposed to exit with status 2, not 
{proc.returncode}"
+if proc.returncode != 2:
+    msg = str(proc.stderr, 'utf-8')
+    print(f"mclient is supposed to exit with status 2, not 
{proc.returncode}.\n--- stderr ---\n{msg}\n---end stderr ---", file=sys.stderr)
+    exit(1)
 
-# We expect the server to send something like 'HTTP/1.1 400 Bad Request'
-# libmapi will interpret the first two bytes as a block header.
+# After the TLS handshake succeeds we expect the server to send something like
+# 'HTTP/1.1 400 Bad Request' because we're sending \x00\x00 instead of an HTTP
+# request. libmapi will interpret the first two bytes 'H' and 'T' as an invalid
+# block header.
 #
-# In ASCII, 'H' + 256 * 'T' is 21576.
-if b'21576' not in proc.stderr:
+# In ASCII,  'H' + 256 * 'T'  ==  72 + 256 * 84  ==  21576.
+tls_works_but_mapi_fails = b'21576' in proc.stderr
+
+if not tls_works_but_mapi_fails:
     msg = str(proc.stderr, 'utf-8')
     print(f"Expected mclient to print an error message containing the number 
21576, got:\n--- stderr ---\n{msg}\n---end stderr ---", file=sys.stderr)
     exit(1)
diff --git a/clients/mapilib/Tests/tests.md b/clients/mapilib/Tests/tests.md
--- a/clients/mapilib/Tests/tests.md
+++ b/clients/mapilib/Tests/tests.md
@@ -258,6 +258,7 @@ EXPECT port=-1
 EXPECT database=
 EXPECT tableschema=
 EXPECT table=
+EXPECT binary=on
 ```
 
 ### sock
@@ -272,6 +273,15 @@ ACCEPT monetdb:///?sock=C:\TEMP\sock
 EXPECT sock=C:\TEMP\sock
 ```
 
+### sockdir
+
+```test
+EXPECT sockdir=/tmp
+ACCEPT monetdb:///demo?sockdir=/tmp/nonstandard
+EXPECT sockdir=/tmp/nonstandard
+EXPECT connect_unix=/tmp/nonstandard/.s.monetdb.50000
+```
+
 ### cert
 
 ```test
@@ -321,15 +331,40 @@ REJECT monetdbs:///?certhash={sha99}X
 
 ```test
 EXPECT clientkey=
+EXPECT clientcert=
 ACCEPT monetdbs:///?clientkey=/tmp/clientkey.pem
 EXPECT clientkey=/tmp/clientkey.pem
 ACCEPT monetdbs:///?clientkey=C:\TEMP\clientkey.pem
 EXPECT clientkey=C:\TEMP\clientkey.pem
 ```
 
-### clientcert
+```test
+EXPECT connect_clientkey=
+EXPECT connect_clientcert=
+```
+
+```test
+SET clientkey=/tmp/key.pem
+SET clientcert=/tmp/cert.pem
+EXPECT valid=true
+EXPECT connect_clientkey=/tmp/key.pem
+EXPECT connect_clientcert=/tmp/cert.pem
+```
 
 ```test
+SET clientkey=/tmp/key.pem
+EXPECT valid=true
+EXPECT connect_clientkey=/tmp/key.pem
+EXPECT connect_clientcert=/tmp/key.pem
+```
+
+```test
+SET clientcert=/tmp/cert.pem
+EXPECT valid=false
+```
+
+```test
+SET clientkey=dummy
 EXPECT clientcert=
 ACCEPT monetdbs:///?clientcert=/tmp/clientcert.pem
 EXPECT clientcert=/tmp/clientcert.pem
@@ -471,14 +506,8 @@ ACCEPT monetdb:///?binary=0100
 EXPECT connect_binary=100
 ```
 
-We take empty to be 'on'
-
 ```test
-ACCEPT monetdb:///?binary=
-EXPECT connect_binary=65535
-```
-
-```test
+REJECT monetdb:///?binary=
 REJECT monetdb:///?binary=-1
 REJECT monetdb:///?binary=1.0
 REJECT monetdb:///?binary=banana
@@ -1129,6 +1158,21 @@ EXPECT connect_tcp=not.localhost
 REJECT monetdbs://not.localhost/?sock=/a/path
 ```
 
+### sock and sockdir
+
+Sockdir only applies to implicit Unix domain sockets,
+not to ones that are given explicitly
+
+```test
+EXPECT sockdir=/tmp
+EXPECT port=-1
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to