iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

[Bug] The NOT unary prefix operator returns a 305 internal server error.

Open LingweiKuang opened this issue 1 year ago • 1 comments

Search before asking

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

Version

+-------+---------+ |Version|BuildInfo | +-------+---------+ | 1.3.2| aa0ff4a | +-------+---------+

Describe the bug and provide the minimal reproduce step

DROP DATABASE root.db0
CREATE DATABASE root.db0

INSERT INTO root.db0(t1) VALUES (1)
INSERT INTO root.db0(timestamp, t1) VALUES (13453556, 2)
INSERT INTO root.db0(timestamp, t1) VALUES (1519786882, 3)

# query 1
SELECT t1 FROM root.db0 WHERE !(2 + 50)
SELECT t1 FROM root.db0 WHERE !(2 / 50)

# query 2
SELECT t1 FROM root.db0 WHERE !100

What did you expect to see?

Query 1 and Query 2 should return the same error message.

What did you see instead?

Query 1 returns Msg: 305: [INTERNAL_SERVER_ERROR(305)] Exception occurred: "SELECT t1 FROM root.db0 WHERE !(2 + 50)". executeStatement failed. Unsupported expression type: ADDITION error. Query 2 returns Msg: 701: Invalid input expression data type. expression: 100, actual data type: INT64, expected data type(s): [BOOLEAN]. error.

Anything else?

Dear IoTDB team, I believe the 305 internal error returned by Query 1 should be classified as a logical bug, as it may lead to user misunderstanding.In Query 1, besides addition, other binary arithmetic operators also exhibit the same vulnerability. If it is a bug, please mark this issue as "bug". Thank you!

Are you willing to submit a PR?

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

LingweiKuang avatar Oct 11 '24 12:10 LingweiKuang

Hi, this is your first issue in IoTDB project. Thanks for your report. Welcome to join the community!

github-actions[bot] avatar Oct 11 '24 12:10 github-actions[bot]

It's not a bug, in current version, we don't support constant expression in where or select clause.

JackieTien97 avatar Oct 28 '24 08:10 JackieTien97