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

Complex expression with comparison evaluates incorrectly in WHERE clause #3854

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

Comments

@monetdb-team
Copy link

Date: 2015-11-09 11:26:50 +0100
From: @rkoopmanschap
To: SQL devs <>
Version: 11.21.11 (Jul2015-SP1)
CC: @njnes

Last updated: 2016-01-15 11:37:57 +0100

Comment 21486

Date: 2015-11-09 11:26:50 +0100
From: @rkoopmanschap

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0
Build Identifier:

This bug is similar, but not the same as bug #3851. In the query below a comparison is used "15 > 1". The outcome of the comparison should not matter as the whole expression should evaluate to FALSE regardless, but the presence of the comparison makes it evaluate to TRUE. The bug does not seem to occur if anything else than a comparison with a variable is put here, including "15 > 1" or "TRUE".

This was tested in a version that already fixed bug #3851.

Reproducible: Always

Steps to Reproduce:

Run the following commands in mclient:

CREATE TABLE test (id INTEGER, foo INTEGER);
INSERT INTO test VALUES (1, 1);
SELECT t.id, t.foo FROM test t
WHERE FALSE
AND (TRUE OR TRUE)
AND ((FALSE AND (TRUE OR FALSE))
OR (15 > t.foo)
);

Actual Results:

+------+------+
| id | foo |
+======+======+
| 1 | 1 |
+------+------+

Expected Results:

+----+-----+
| id | foo |
+====+=====+
+----+-----+

This is a bug report from our client CHS.

Comment 21487

Date: 2015-11-09 11:36:19 +0100
From: MonetDB Mercurial Repository <>

Changeset a84afe3cb9fc made by Richard Koopmanschap richard.koopmanschap@monetdbsolutions.com in the MonetDB repo, refers to this bug.

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

Changeset description:

Added test for bug #3854

Comment 21488

Date: 2015-11-09 13:47:14 +0100
From: @njnes

fixed. The sql select push down lost one of the boolean expressions. This is fixed now..

Comment 21489

Date: 2015-11-09 15:25:35 +0100
From: MonetDB Mercurial Repository <>

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

Changeset description:

fixed bug #3854
@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