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

Assertion failure in rel_bin.c:2274: rel2bin_project: Assertion `0' failed. #3705

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: 2015-04-16 14:26:39 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.19.9 (Oct2014-SP2)
CC: @njnes

Last updated: 2015-06-22 22:32:24 +0200

Comment 20802

Date: 2015-04-16 14:26:39 +0200
From: Martin van Dinther <<martin.van.dinther>>

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

SQL Query:
SELECT CASE WHEN c>(SELECT avg(c) FROM t1) THEN a2 ELSE b10 END FROM t1;
causes assertion failure

Reproducible: Always

Steps to Reproduce:

  1. Start mserver5 (MonetDB 5 server v11.19.9 "Oct2014-SP2")
  2. Start mclient
  3. execute SQL commands:
    CREATE TABLE t1(a INTEGER, b INTEGER, c INTEGER, d INTEGER, e INTEGER);
    INSERT INTO t1(e,c,b,d,a) VALUES(103,102,100,101,104);
    SELECT CASE WHEN c>(SELECT avg(c) FROM t1) THEN a2 ELSE b10 END FROM t1;

Actual Results:

builtin opt gdk_dbpath = /export/scratch1/dinther/Downloads/INSTALL/var/monetdb5/dbfarm/demo
builtin opt gdk_debug = 0
builtin opt gdk_vmtrim = no
builtin opt monet_prompt = >
builtin opt monet_daemon = no
builtin opt mapi_port = 50000
builtin opt mapi_open = false
builtin opt mapi_autosense = false
builtin opt sql_optimizer = default_pipe
builtin opt sql_debug = 0
cmdline opt gdk_debug = 10
MonetDB 5 server v11.19.9 "Oct2014-SP2"
Serving database 'demo', using 8 threads
Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked
Found 15.590 GiB available main-memory.
Copyright (c) 1993-July 2008 CWI.
Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
Visit http://www.monetdb.org/ for further information
Listening for connection requests on mapi:monetdb://127.0.0.1:50000/
MonetDB/GIS module loaded
MonetDB/SQL module loaded

could not find t1.a
t1.c
L1.L1
mserver5: ../../../../MonetDB-11.19.9/sql/backends/monet5/rel_bin.c:2274: rel2bin_project: Assertion `0' failed.
bash-4.2$

Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.19.9 (Oct2014-SP2), 'demo'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>CREATE TABLE t1(a INTEGER, b INTEGER, c INTEGER, d INTEGER, e INTEGER);
operation successful (7.575ms)
sql>INSERT INTO t1(e,c,b,d,a) VALUES(103,102,100,101,104);
1 affected row (1.117ms)
sql>SELECT avg(c) FROM t1;
+--------------------------+
| L1 |
+==========================+
| 102 |
+--------------------------+
1 tuple (1.247ms)
sql>SELECT CASE WHEN c>(SELECT avg(c) FROM t1) THEN a2 ELSE b10 END FROM t1;
sql>
bash-4.2$

Expected Results:

no assertion failure

Also happens on MonetDB 5 server v11.20.0:
mserver5: ../../../../dev/sql/backends/monet5/rel_bin.c:2234: rel2bin_project: Assertion `0' failed.

Comment 20814

Date: 2015-04-19 13:27:22 +0200
From: MonetDB Mercurial Repository <>

Changeset 33ac46bb0409 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=33ac46bb0409

Changeset description:

fixed bug #3705, ie handle subquery projections better

Comment 20818

Date: 2015-04-19 21:29:05 +0200
From: @njnes

Fixed (properly pass all projection expressions) and added test

Comment 20896

Date: 2015-05-28 16:44:53 +0200
From: Martin van Dinther <<martin.van.dinther>>

Reopened because when I extend the SELECT query with "abs(b-c)" as in:
SELECT abs(b-c), CASE WHEN c>(SELECT avg(c) FROM t1) THEN a2 ELSE b10 END FROM t1;
or
SELECT CASE WHEN c>(SELECT avg(c) FROM t1) THEN a2 ELSE b10 END, abs(b-c) FROM t1;

I again get the assertion failure:
mserver5: ../../../../MonetDB-11.19.11/sql/backends/monet5/rel_bin.c:2279: rel2bin_project: Assertion `0' failed.

This happens on MonetDB 5 server v11.19.11 "Oct2014-SP3" and on MonetDB 5 server v11.20.0. (built on 28 may 2015).

On MonetDB 5 server v11.20.0 I get:
mserver5: ../../../../dev/sql/backends/monet5/rel_bin.c:2352: rel2bin_project: Assertion `0' failed.

I have extended BugTracker-2015/Tests/case_aggr.Bug-3705.sql and stable.out with the new SELECT statements and desired output.

Comment 20897

Date: 2015-05-28 16:47:45 +0200
From: MonetDB Mercurial Repository <>

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

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=e946d6eed01a

Changeset description:

Variants of SELECT query still produce same assertion failure as reported in bug #3705
Extended test case with those SELECTs and reopened bug #3705
@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