Skip to content

Unexpected result when using IN with TIME values #13813

@suyZhong

Description

@suyZhong

What happens?

Consider the following test cases. The second query should return true since the value after casting is 12:34:56 and the IN expression should be evaluated to true. Besides, if the false is expected, its negation query should not be evaluated as false.

To Reproduce

DROP TABLE IF EXISTS t1;
CREATE   TABLE  t1(c0 TIME WITH TIME ZONE);
INSERT INTO t1(c0) VALUES ('12:34:56');

SELECT t1.c0 FROM t1; -- 12:34:56+08

SELECT (CAST(t1.c0 AS TIME) IN ('12:34:56')) FROM t1; -- false (unexpected)
SELECT NOT (CAST(t1.c0 AS TIME) IN ('12:34:56')) FROM t1; -- false

OS:

ubuntu 22.04

DuckDB Version:

v1.0.1-dev5313 64bacde

DuckDB Client:

CLI

Hardware:

No response

Full Name:

Suyang Zhong

Affiliation:

NUS

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a nightly build

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions