iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

OR FALSE trigger error

Open panta-k opened this issue 3 months ago • 1 comments

Search before asking

  • [x] I searched in the issues and found nothing similar.

Version

2.0.5 (build: 0917050)

Describe the bug and provide the minimal reproduce step

DELETE DATABASE root.min; CREATE DATABASE root.min;

CREATE TIMESERIES root.min.t1.c0 INT64; CREATE TIMESERIES root.min.t1.c2 INT64; CREATE TIMESERIES root.min.t1.c3 DOUBLE;

INSERT INTO root.min.t1(time, c0, c2, c3) VALUES (1641024300000, 1, 2, 111.0);

--query 1 SELECT c2, c0, c3 FROM root.min.t1 WHERE (111.0 = c3) & ((time BETWEEN 1641088367591 AND 1696815489424) | (time IN (1659164962649))) AND (time BETWEEN 1641024265420 AND 1641024393069);

-- query 2 SELECT c2, c0, c3 FROM root.min.t1 WHERE ((111.0 = c3) & ((time BETWEEN 1641088367591 AND 1696815489424) | (time IN (1659164962649)))) AND (time BETWEEN 1641024265420 AND 1641024393069) OR FALSE;

What did you expect to see?

query 1: return empty set

query 2: return empty set

What did you see instead?

query 1: return empty set

query 2: return error

Image

Anything else?

No response

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

panta-k avatar Sep 22 '25 02:09 panta-k

SELECT c2, c0, c3 FROM root.min.t1 WHERE ((111.0 = c3) & ((time BETWEEN 1641088367591 AND 1696815489424) | (time IN (1659164962649)))) AND (time BETWEEN 1641024265420 AND 1641024393069) OR FALSE;

The OR FALSE at the tail can be removed, but rewriting is not currently supported, can try OR 1!=1

CritasWang avatar Sep 29 '25 11:09 CritasWang