Navigation Menu

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_select.c for correlated subquery in aggregation query (with group by and having and order by and limit) #6714

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: 2019-06-12 18:02:50 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.33.3 (Apr2019)
CC: @njnes

Last updated: 2019-09-02 16:05:27 +0200

Comment 27060

Date: 2019-06-12 18:02:50 +0200
From: Martin van Dinther <<martin.van.dinther>>

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

Correlated subquery
(select name from functions f where f.id = func_id) as name
on an aggregation query
select func_id, max(number), count() from args group by func_id having count() > 8 order by func_id limit 12;
triggers an internal assertion in sql/server/rel_select.c:3790: rel_intermediates_add_exp: Assertion `pp->op == op_project' failed.

Reproducible: Always

Steps to Reproduce:

  1. start mserver5 (MonetDB 5 server v11.33.4)
  2. start mclient
  3. issue SQL query: select func_id, (select name from functions f where f.id = func_id) as name, max(number), count() from args group by func_id having count() > 8 order by func_id limit 12;

Actual Results:

mserver5: dev/sql/server/rel_select.c:3599: rel_intermediates_add_exp: Assertion `pp->op == op_project' failed.

Expected Results:

+---------+----------------+------+------+
| func_id | fname | L6 | L10 |
+=========+================+======+======+
| 1495 | copyfrom | 12 | 13 |
| 6743 | querylog_calls | 8 | 9 |
| 6802 | tracelog | 12 | 13 |
| 7234 | bbp | 10 | 11 |
| 8531 | storage | 16 | 17 |
| 8589 | storage | 17 | 18 |
| 8609 | storage | 18 | 19 |
| 8630 | storage | 19 | 20 |
+---------+----------------+------+------+
8 tuples

Mserver5 compiled from latest source (Apr2019 branch) on 12 june 2019.
It also fails on default branch with:
sql/server/rel_select.c:3790: rel_intermediates_add_exp: Assertion `pp->op == op_project' failed.

Comment 27064

Date: 2019-06-13 10:59:57 +0200
From: MonetDB Mercurial Repository <>

Changeset 6058b1a40460 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=6058b1a40460

Changeset description:

Added test for bug #6714.

Comment 27067

Date: 2019-06-13 15:47:50 +0200
From: MonetDB Mercurial Repository <>

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

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

Changeset description:

fix crash (incorrect assert) in rel_intermediates (fixes bug #6714)

Comment 27070

Date: 2019-06-17 10:52:23 +0200
From: MonetDB Mercurial Repository <>

Changeset 4c999d6e4f8a 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=4c999d6e4f8a

Changeset description:

Re-worked bug #6714 test.

Don't use system tables in tests, as their contents change overtime. These changes require to re-approve tests again.
@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