apache / apache/iotdb

[Bug] There is a logical error in performing multiplication operations with a value of 0.

オープン
#14,291 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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 1.3.3 (Build: ad95a7e)

### Describe the bug and provide the minimal reproduce step

```
DROP DATABASE root.db0
CREATE DATABASE root.db0

CREATE TIMESERIES root.db0.t1 WITH datatype=INT32;
INSERT INTO root.db0(timestamp, t1) VALUES (1641024000000, 0);

# query 1
SELECT t1 FROM root.db0 WHERE (-1) * t1 == 0;

# query 2
SELECT t1 FROM root.db0 WHERE (-1) * t1 == -0.0;
```

### What did you expect to see?

Query 1 returned result set: **0**

Query 2 returned result set: **0**

### What did you see instead?

Query 1 returned result set: **empty set**

Query 2 returned result set: **0**

### Anything else?

Dear IoTDB team, In the query above, the result of the expression `(-1) * t1` is `-0.0`. In principle, this value should be equivalent to `0`. However, a comparison of the results from Query 1 and Query 2 indicates that the two are not equal. The same logical error also exists in division operations.

### Are you willing to submit a PR?

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、提供された2つのIoTDB SQLクエリをバージョン1.3.3に対して実行し、それらの述語の結果を比較します。次に、乗算と除算で使用される式評価を追跡し、その後、0と-0.0を含む比較が期待どおりの結果になることを、その他のクエリ動作を変更せずに確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, sql
領域
databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。