apache / apache/iotdb

OR FALSE trigger error

Open
#16,453 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
115

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/iotdb/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!

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied database setup and the two SELECT statements against IoTDB 2.0.5, then compare query 2's error with query 1's empty result. Done means the query containing OR FALSE returns an empty set instead of an error while preserving the behavior of query 1.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.