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

Sqlitelogictest - Select not between query producing wrong results #6497

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

Comments

@monetdb-team
Copy link

Date: 2017-12-13 17:36:57 +0100
From: @PedroTadim
To: SQL devs <>
Version: -- development
CC: @njnes

Last updated: 2018-02-12 16:12:18 +0100

Comment 26006

Date: 2017-12-13 17:36:57 +0100
From: @PedroTadim

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
Build Identifier:

A simple select query with a not between predicate is producing wrong results.

Reproducible: Always

Steps to Reproduce:

  1. CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER);
  2. INSERT INTO tab0 VALUES(97,1,99);
  3. INSERT INTO tab0 VALUES(15,81,47);
  4. INSERT INTO tab0 VALUES(87,21,10);
  5. SELECT * FROM tab0 WHERE + col1 NOT BETWEEN col2 + - 99 AND + 20;

Actual Results:

+------+------+------+
| col0 | col1 | col2 |
+======+======+======+
| 97 | 1 | 99 |
+------+------+------+

Expected Results:

+------+------+------+
| col0 | col1 | col2 |
+======+======+======+
| 15 | 81 | 47 |
| 87 | 21 | 10 |
+------+------+------+

Comment 26007

Date: 2017-12-13 17:38:13 +0100
From: MonetDB Mercurial Repository <>

Changeset 64a5f2bfdb52 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=64a5f2bfdb52

Changeset description:

Added test for Bug #6497

Comment 26011

Date: 2017-12-15 13:55:29 +0100
From: @sjoerdmullender

Somehow the "NOT" gets lost: the query plans for the two queries
SELECT * FROM tab0 WHERE + col1 NOT BETWEEN col2 + - 99 AND + 20;
and
SELECT * FROM tab0 WHERE + col1 BETWEEN col2 + - 99 AND + 20;
are identical.

Comment 26015

Date: 2017-12-16 12:00:49 +0100
From: MonetDB Mercurial Repository <>

Changeset a3a06432dc17 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a3a06432dc17

Changeset description:

fixes for bug #6491 (select returns null)
	  bug #6497 (incorrect not between)
 	  bug #6490 (handle multiple columns in in in selection)

fixed type checking, allowed more equal types (int with 17 bits equals one with 31 etc)
@monetdb-team monetdb-team added bug Something isn't working normal 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 normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants