Logical AND Error causing - 305 INTERNAL_SEVER_ERROR
- 主要言語
- Java
- スター
- 6.4k
- フォーク
- 1.2k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 115
説明
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.
### Version
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.c0 INT64;
CREATE TIMESERIES root.db1.t2.c1 INT64;
CREATE TIMESERIES root.db1.t2.c2 INT32;
INSERT INTO root.db1.t2(timestamp, c0, c1, c2) VALUES (1641024000000, 123, 1, 456);
#query 1
SELECT c2 AS ref0, c0 AS ref1 FROM root.db1.t2 WHERE c1 = 1 OR 1=0;
#query 2
SELECT c2 AS ref0, c0 AS ref1 FROM root.db1.t2 WHERE c1 = 1 OR 1!=0;
#query 3
SELECT c2 AS ref0, c0 AS ref1 FROM root.db1.t2 WHERE c1 = 1 AND 1=1;
### What did you expect to see?
query 1 : return 1 result
query2 : return 1 result
query3 : return 1 result
### What did you see instead?
query 1 : return 1 result
query2 : return 1 result
query3 : 305 INTERNAL_SERVER_ERROR
### Anything else?
dear IoTDB team, I found out adding a logically neutral constant to a WHERE clause using AND 1 = 1 causes INTERNAL_SERVER_ERROR (305), while the equivalent OR 1=1 does not.
This looks like the crash is tied to neutral conjuncts in AND
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
コントリビューションガイド
調査の方向性
まず、IoTDB 2.0.5 に対して 3 つの SQL 再現を実行し、AND と OR のケースを比較します。WHERE 式が定数比較をどのように処理するかを追跡し、その後 query 3 の回帰テストカバレッジを追加します。完了条件は、3 つすべてのクエリが 305 エラーなしで 1 件の結果を返すことです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, sql
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100