Skip to content

Unexpected result when using CASE WHEN #7429

Closed

Description

@suyZhong

Describe the bug
Consider the test cases below. It is unexpected that the second query and the third query return the same result (a), since the expression could not be evaluated to true or null at the same time.

To Reproduce

DROP TABLE IF EXISTS t0 CASCADE;

CREATE TABLE t0(c0 VARCHAR);
INSERT INTO t0 (c0) VALUES ('a');

SELECT * FROM t0; -- a
SELECT * FROM t0 WHERE (((CASE (NULL)/(1) WHEN NULL THEN true END )OR(false)) IS NULL); -- a
SELECT * FROM t0 WHERE (CASE (NULL)/(1) WHEN NULL THEN true END )OR(false); -- a (likely unexpected here)

Expected behavior
As mentioned above

Screenshots
N/A

Software versions
Build from source:

root@035e0b00c896:/app# mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 3bb73c2) (64-bit, 128-bit integers)
This is an unreleased version
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2023 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 503.5GiB available memory, 128 available cpu cores
Libraries:
Compiled by: @897761d12f5d (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc 
Linking    : /usr/bin/ld

Issue labeling
Bug

Additional context
Add any other context about the problem here.

Activity

  1. lrpereira commented on Jan 24, 2024

    @lrpereira
    Member

    Thanks for the report.
    Fixed in Dec2023 branch.

  2. added this to the NEXTRELEASE milestone on Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions