taosdata / TDengine

High-performance, scalable time-series database designed for Industrial IoT (IIoT) scenarios
https://tdengine.com
GNU Affero General Public License v3.0
23.4k stars 4.86k forks source link

An exception is triggered when the NOT operator is used in combination with the equality comparison operator. #28342

Open LingweiKuang opened 1 month ago

LingweiKuang commented 1 month ago

Bug Description

The combination of the NOT operator and binary comparison operators triggers an "Unexpected generic error".

To Reproduce

Assume that we execute the following statement under a database named testdb.

DROP TABLE IF EXISTS t1;

CREATE TABLE IF NOT EXISTS t1( time TIMESTAMP, c0 VARCHAR(100) );
INSERT INTO t1(time, c0) VALUES (1641024000000, "1");
INSERT INTO t1(time, c0) VALUES (1641024000001, "2");

# query success
SELECT time, c0 FROM t1 WHERE NOT (("1") <> (c0));

# query error
SELECT time, c0 FROM t1 WHERE NOT (("1") = (c0));

Expected Behavior

Both Query 1 and Query 2 are executed successfully, and both return one row of data.

Actual behaviour

Query 1 returns the expected result, while Query 2 fails to execute, returning the error: "Unexpected generic error".

Environment

Additional Context

Hello, TDengine team. I'd like to confirm with you whether this is a bug?

yu285 commented 1 week ago

please use next version to verify this again .thanks for your feedback