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

LEFT JOIN with OR conditions triggers assertion #3908

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

LEFT JOIN with OR conditions triggers assertion #3908

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

Comments

@monetdb-team
Copy link

Date: 2016-01-25 11:36:08 +0100
From: @yzchang
To: SQL devs <>
Version: 11.21.13 (Jul2015-SP2)
CC: @njnes

Last updated: 2016-03-25 09:59:20 +0100

Comment 21745

Date: 2016-01-25 11:36:08 +0100
From: @yzchang

The following SELECT query triggers an assertion in rel_bin.c:673.

Playing a bit with some alternatives of the SELECT query reveals that the problem lies in the combination of LEFT JOIN and the OR condition. Queries without either the LEFT JOIN or the 'OR' condition work fine.

I'll add a test for this shortly.

==============
CREATE TABLE foo (id INTEGER, bar1 INTEGER, bar2 INTEGER);
CREATE TABLE bar (barid INTEGER, value CHAR(10));
INSERT INTO bar VALUES (1, 'aaa');
INSERT INTO bar VALUES (2, 'bbb');
INSERT INTO bar VALUES (3, 'ccc');
INSERT INTO foo VALUES (100, 1, 2);
INSERT INTO foo VALUES (101, 2, 3);
SELECT B.value, F.id FROM bar B LEFT JOIN foo F ON (F.bar1 = B.barid OR F.bar2 = B.barid);

Comment 21746

Date: 2016-01-25 12:39:01 +0100
From: MonetDB Mercurial Repository <>

Changeset cc9d1446c68d made by Jennie Zhang y.zhang@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

Added test for Bug #3908

Comment 21749

Date: 2016-01-25 12:56:51 +0100
From: MonetDB Mercurial Repository <>

Changeset 45e43b607470 made by Jennie Zhang y.zhang@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

Enable test for Bug #3908

Comment 21758

Date: 2016-01-31 21:15:46 +0100
From: MonetDB Mercurial Repository <>

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

Changeset description:

rewrite outer-joins with or expressions, fixes bug #3908.

Comment 21759

Date: 2016-01-31 21:44:31 +0100
From: @njnes

outer joins with or expressions were not correctly handled. Is fixed now.

Comment 21961

Date: 2016-03-25 09:59:20 +0100
From: @sjoerdmullender

Jul2015-SP3 has been released.

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