Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of multiple column expressions in where-clause (f(a), f(b)) in (select a, b) causes assertion failure on mserver5 #6818

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working major SQL

Comments

@monetdb-team
Copy link

Date: 2020-02-13 15:24:50 +0100
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.35.9 (Nov2019-SP1)
CC: @PedroTadim

Last updated: 2020-06-03 16:58:53 +0200

Comment 27544

Date: 2020-02-13 15:24:50 +0100
From: Martin van Dinther <<martin.van.dinther>>

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0
Build Identifier:

sql/backends/monet5/rel_bin.c:920: exp_bin: Assertion `0' failed.
mserver5 is killed.

Reproducible: Always

Steps to Reproduce:

  1. start mserver5 (compiled from Nov2019 branch on 13 febr 2020 with assertions enabled: --enable-assert --disable-debug)
  2. start mclient
  3. run sql commands:
    CREATE TABLE "dd_field" (
    "TABEL" VARCHAR(25) NOT NULL,
    "VELD" VARCHAR(25) NOT NULL,
    "TYPE" VARCHAR(4) NOT NULL
    );

select "TABEL", "VELD"
from dd_field f
where ("TABEL", "VELD") in (select "TABEL", "VELD" from dd_field);
-- no problemo

select "TABEL", "VELD"
from dd_field f
where (rtrim("TABEL"), rtrim("VELD")) in (select "TABEL", "VELD" from dd_field);
-- server reports: Assertion `0' failed and stops the server.

Actual Results:

dinther@monetdb-nuc2 ~]$ ./start_INSTALL_mserver5.sh
builtin opt gdk_dbpath = /home/dinther/dev/dev/INSTALL/var/monetdb5/dbfarm/demo
builtin opt mapi_port = 50000
builtin opt mapi_open = false
builtin opt mapi_ipv6 = false
builtin opt mapi_autosense = false
builtin opt sql_optimizer = default_pipe
builtin opt sql_debug = 0
cmdline opt embedded_r = true
cmdline opt embedded_py = 3
cmdline opt embedded_c = true
cmdline opt mapi_port = 41000
MonetDB 5 server v11.35.14 (hg id: 6146f33fc10b)
This is an unreleased version
Serving database 'demo', using 8 threads
Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
Found 31.237 GiB available main-memory of which we use 25.459 GiB
Copyright (c) 1993 - July 2008 CWI.
Copyright (c) August 2008 - 2020 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Listening for connection requests on mapi:monetdb://127.0.0.1:41000/
MonetDB/GIS module loaded
MonetDB/SQL module loaded
MonetDB/Python3 module loaded
MonetDB/R module loaded
mserver5: /home/dinther/dev/dev/MonetDB/sql/backends/monet5/rel_bin.c:920: exp_bin: Assertion `0' failed.
./start_INSTALL_mserver5.sh: line 8: 895328 Aborted (core dumped) /home/dinther/dev/dev/INSTALL/bin/mserver5 -d10 --set embedded_r=true --set embedded_py=3 --set embedded_c=true --set mapi_port=41000
[dinther@monetdb-nuc2 ~]$

[dinther@monetdb-nuc2 Tests]$ mclient -p41000
Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.35.14 (hg id: 6146f33fc10b), 'demo'
FOLLOW US on https://twitter.com/MonetDB or https://github.com/MonetDB/MonetDB
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>CREATE TABLE "dd_field" (
more> "TABEL" VARCHAR(25) NOT NULL,
more> "VELD" VARCHAR(25) NOT NULL,
more> "TYPE" VARCHAR(4) NOT NULL
more>);
operation successful
sql>select "TABEL", "VELD"
more> from dd_field f
more> where ("TABEL", "VELD") in (select "TABEL", "VELD" from dd_field)
more>;
+-------+------+
| TABEL | VELD |
+=======+======+
+-------+------+
0 tuples
sql>select "TABEL", "VELD"
more> from dd_field f
more> where ("TABEL", "VELD") in (select "TABEL", "VELD" from dd_field);
+-------+------+
| TABEL | VELD |
+=======+======+
+-------+------+
0 tuples
sql>select "TABEL", "VELD"
more> from dd_field f
more> where (rtrim("TABEL"), rtrim("VELD")) in (select "TABEL", "VELD" from dd_field);
sql>
write error on stream
[dinther@monetdb-nuc2 Tests]

Expected Results:

No assertion error or killing of the server.

On windows (Nov2019-SP2 release candidate of 12 febr 2020 without assertions) I got:
client2:!ERROR:MALException:optimizer.garbagecollector:42000!Incorrect MAL plan encountered
instead.

Comment 27545

Date: 2020-02-13 15:34:02 +0100
From: MonetDB Mercurial Repository <>

Changeset 1b4a2a363dbc made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1b4a2a363dbc

Changeset description:

Add test for bug #6818

Comment 27546

Date: 2020-02-13 15:48:56 +0100
From: MonetDB Mercurial Repository <>

Changeset 728077f72f6d made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=728077f72f6d

Changeset description:

Set bug #6818 as KNOWNFAIL. Tuple matching IN operator was fixed in the subquery branch and it will be available in the next feature release

Comment 27547

Date: 2020-02-13 17:16:33 +0100
From: Martin van Dinther <<martin.van.dinther>>

Additional test query:

select "TABEL", "VELD"
from dd_field f
where (rtrim("TABEL")) in (select "TABEL" from dd_field);

also has no problem.

So the problem occurs only when using multiple columns with an expression (such as rtrim()) are used, such as:
where (rtrim("TABEL"), rtrim("VELD")) in (select "TABEL", "VELD" from dd_field);

Comment 27548

Date: 2020-02-14 05:51:58 +0100
From: Martin van Dinther <<martin.van.dinther>>

Additional Info:
It worked OK on older versions. I tested:
MonetDB 5 server v11.29.7 "Mar2018-SP1"
MonetDB 5 server v11.33.11 (Apr2019-SP1)

But fails since:
MonetDB 5 server v11.35.3 (Nov2019)
and releases:
MonetDB 5 server v11.35.9 (Nov2019-SP1)
MonetDB 5 server v11.35.13 (Nov2019-SP2)

with mclient showing:

sql>select "TABEL", "VELD"
more> from dd_field f
more> where (rtrim("TABEL"), rtrim("VELD")) in (select "TABEL", "VELD" from dd_field);
Error in optimizer garbageCollector
sql>

and mserver5 console lists:
client1:!ERROR:MALException:optimizer.garbagecollector:42000!Incorrect MAL plan encountered
client1:!ERROR:MALException:garbageCollector:42000!Error in optimizer garbageCollector
client1:!ERROR:MALException:garbageCollector:42000!Error in optimizer garbageCollector

@monetdb-team monetdb-team added bug Something isn't working major SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major SQL
Projects
None yet
Development

No branches or pull requests

2 participants