apache / apache/iotdb

Logical OR causes 305 INTERNAL SERVER ERROR

未关闭
#16,408 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
6.4k
派生
1.2k
平均合并
1 天 23 小时
30 天内合并 PR
115

描述

### 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.db1;
CREATE DATABASE root.db1;

CREATE TIMESERIES root.db1.t2.c1 INT64;
CREATE TIMESERIES root.db1.t2.c3 INT64;

INSERT INTO root.db1.t2(timestamp, c1, c3) VALUES (1707690567134, 1, 10);

#query 1
SELECT c1 AS ref0, c3 AS ref1
FROM root.db1.t2
WHERE (time == 1707690567134) AND (time NOT IN (1658432578669));

#query 2
SELECT c1 AS ref0, c3 AS ref1
FROM root.db1.t2
WHERE ((time == 1707690567134) AND (time NOT IN (1658432578669))) OR TRUE;

#query 3
SELECT c1 AS ref0, c3 AS ref1
FROM root.db1.t2
WHERE ((time == 1707690567134) AND (time NOT IN (1658432578669))) OR 1=1;

### What did you expect to see?

query 1 : return 1 value

query 2 : return same value

query 3 : return same value

### What did you see instead?

query 1 : return 1 value

query 2 : return same value

query 3 : 305 INTERNAL SERVER ERROR

Image

### Anything else?

OR 1=1 works in simple queries, but when combined with a time filter and time NOT IN (...), the query fails with 305 INTERNAL_SERVER_ERROR. The same predicate using OR TRUE runs fine.

### Are you willing to submit a PR?

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

贡献指南

打开贡献指南

调研方向

首先针对 IoTDB 2.0.5 运行三个 SQL 查询,对比正常工作的 OR TRUE 情况与失败的 OR 1=1 情况。跟踪与 NOT IN 组合的时间过滤器所经过的查询规划或表达式求值路径;完成的标准是查询 3 返回与查询 1 和 2 相同的值,而不是 305 INTERNAL SERVER ERROR。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, sql
领域
databases
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。