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

Database crashes when querying with several UNION ALLs. #3879

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Database crashes when querying with several UNION ALLs. #3879

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-12-01 18:45:54 +0100
From: Frédéric Jolliton <<frederic.jolliton+monetdb>>
To: SQL devs <>
Version: 11.17.21 (Jan2014-SP3)
CC: martin.van.dinther, @njnes

Last updated: 2016-01-15 11:38:04 +0100

Comment 21623

Date: 2015-12-01 18:45:54 +0100
From: Frédéric Jolliton <<frederic.jolliton+monetdb>>

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

A query with a serie of UNION ALLs fails because of an assert that trigger when the optimizer reaches 10 levels (of iterations?).

It fails even with optimizer set to `minimal_pipe'. This is worrying :/

Reproducible: Always

Steps to Reproduce:

  1. Create a simple table:

CREATE TABLE foo (a INT);

  1. Execute the following query:

SELECT 1
FROM (SELECT a FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo
UNION ALL
SELECT 0 FROM foo) AS t;

Actual Results:

The log says:

 mserver5: rel_optimizer.c:7675: _rel_optimizer: Assertion `0' failed.
 database 'test' (12345) was killed by signal SIGABRT

Comment 21624

Date: 2015-12-01 22:48:42 +0100
From: @sjoerdmullender

This only seems to be an actual problem when assertions are enabled. And they're not in binary releases.

Comment 21629

Date: 2015-12-02 14:46:55 +0100
From: Frédéric Jolliton <<frederic.jolliton+monetdb>>

Indeed, we're testing with assert enabled. And it is actually fine with a production release.

We made the assumption that an assert was really pointing at a problem, but you seems to imply that it is benign here. In this case, we will disable this specific assert for our tests.

Thanks.

Comment 21644

Date: 2015-12-07 19:07:00 +0100
From: MonetDB Mercurial Repository <>

Changeset 3c24051e28fa 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=3c24051e28fa

Changeset description:

fixed bug #3879, after pushing down project (through the union), we merge
multiple projects directly.

Comment 21645

Date: 2015-12-07 20:33:07 +0100
From: @njnes

improved the optimizer which solve this recursion.

Comment 21657

Date: 2015-12-10 16:52:04 +0100
From: MonetDB Mercurial Repository <>

Changeset f59d2713050c 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=f59d2713050c

Changeset description:

Corrected wrong bug number. Should be Bug #3879 instead of 3897

Comment 21658

Date: 2015-12-10 16:55:39 +0100
From: Martin van Dinther <<martin.van.dinther>>

Hi Niels,
Found another test case where the assertion:
mserver5: ../../../dev/sql/server/rel_optimizer.c:7680: _rel_optimizer: Assertion `0' failed.
is still occuring.

See test script: sql/test/BugTracker-2015/Tests/many_union_all.Bug-3879.sql

Comment 21660

Date: 2015-12-12 12:36:26 +0100
From: MonetDB Mercurial Repository <>

Changeset bc157090c301 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=bc157090c301

Changeset description:

fixed many_union_all bug #3879

Comment 21661

Date: 2015-12-12 13:13:28 +0100
From: @njnes

fixed, we now cleanup the extra projects right after a project push down union.

@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