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

Incorrect column name in OR condition of LEFT JOIN crashes mserver #3909

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

Incorrect column name in OR condition of LEFT JOIN crashes mserver #3909

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

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

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

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

Comment 21747

Date: 2016-01-25 12:48:17 +0100
From: @yzchang

The following SELECT query triggers a server crash at rel_select.c:3109
while it should have given an error: no such column 'b.id'.

This bug is related/similar to Bug #3908, i.e., the crash only happens with the combination of LEFT JOIN and an OR condition. However, it causes crash elsewhere in the code, hence a separate bug.

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.id);

Comment 21748

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

Changeset 5d43ddd4e314 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=5d43ddd4e314

Changeset description:

Added test for Bug #3909

Comment 21756

Date: 2016-01-28 13:18:51 +0100
From: MonetDB Mercurial Repository <>

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

Changeset description:

fix crash in join with or and incorrect expressions (fixes bug #3909)
remove single 'TRUE' expressions, ie removes lots of unneeded crossproducts.

Comment 21757

Date: 2016-01-30 15:02:36 +0100
From: MonetDB Mercurial Repository <>

Changeset 3940d6dfeed7 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=3940d6dfeed7

Changeset description:

fixed crash in OR with incorrect column name (ie BUG #3909)

Comment 21760

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

we now correctly check for errors in outerjoins with or expressions.

Comment 21979

Date: 2016-03-25 09:59:54 +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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant