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

expression that should evaluate to FALSE evaluates to TRUE in SELECT query #3851

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

Comments

@monetdb-team
Copy link

Date: 2015-11-05 15:09:32 +0100
From: @rkoopmanschap
To: SQL devs <>
Version: 11.21.11 (Jul2015-SP1)
CC: kevin.boulain, @njnes

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

Comment 21469

Date: 2015-11-05 15:09:32 +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:

A select query with an expression in the WHERE clause evaluates incorrectly to TRUE instead of FALSE.

Reproducible: Always

Steps to Reproduce:

  1. Open mclient and use run the following commands:

CREATE TABLE test3 (pid INTEGER);
INSERT INTO test3 VALUES (1);

SELECT t3.pid FROM test3 t3
WHERE FALSE
AND (FALSE OR TRUE)
AND (
(FALSE AND (FALSE OR FALSE))
OR TRUE
);

Actual Results:

+------+
| pid |
+======+
| 1 |
+------+

Expected Results:

+-----+
| pid |
+=====+
+-----+

This is a bug report from the client CHS.

Comment 21471

Date: 2015-11-06 13:58:00 +0100
From: Kevin Boulain <<kevin.boulain>>

Hi,

This bug caught our attention and we tried some minor variants.

Just to let you known, a simple modification triggered a segfault on the Jul2015 SP1 (http://dev.monetdb.org/hg/MonetDB/rev/d1dd6e5b7a5a):
sql>select 1 where false and (false or true) and ((false and (false or false)) or true);

The request is kinda similar to https://www.monetdb.org/bugzilla/show_bug.cgi?id=3829 that we reported earlier.

It was tested on three different systems (Gentoo, Debian and Ubuntu) and crashed on each.

No special flags for the configure, only a --prefix.

mserver5 --version output the following from the Ubuntu system:
MonetDB 5 server v11.21.11 "Jul2015-SP1" (64-bit, 64-bit oids, 128-bit integers)
Copyright (c) 1993-July 2008 CWI
Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
Visit http://www.monetdb.org/ for further information
Found 19.5GiB available memory, 4 available cpu cores
Libraries:
libpcre: 8.35 2014-04-04 (compiled with 8.35)
openssl: OpenSSL 1.0.1f 6 Jan 2014 (compiled with OpenSSL 1.0.1f 6 Jan 2014)
libxml2: 2.9.1 (compiled with 2.9.1)
Compiled by: ether@lethe (x86_64-unknown-linux-gnu)
Compilation: gcc -g -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wpacked -Wunknown-pragmas -Wvariadic-macros -fstack-protector-all -Wstack-protector -Wpacked-bitfield-compat -Wsync-nand -Wjump-misses-init -Wmissing-include-dirs -Wlogical-op -Wunreachable-code
Linking : /usr/bin/ld -m elf_x86_64

Comment 21472

Date: 2015-11-06 14:18:46 +0100
From: MonetDB Mercurial Repository <>

Changeset 1a6c52046b1c 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=1a6c52046b1c

Changeset description:

Added test for bug #3851

Comment 21479

Date: 2015-11-09 08:03:05 +0100
From: MonetDB Mercurial Repository <>

Changeset 05634058c6e2 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=05634058c6e2

Changeset description:

fixed bug #3851, ie handle complex combinations of boolean values

Comment 21482

Date: 2015-11-09 08:38:36 +0100
From: @njnes

fixed in 2015. The complex boolean expressions are now handled properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants