TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

The NOT operator triggers a logical bug.

Open LingweiKuang opened this issue 1 year ago • 0 comments

Bug Description

The NOT operator triggers a logical bug.

To Reproduce

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

DROP TABLE IF EXISTS t1;
CREATE TABLE t1( time TIMESTAMP, c0 BIGINT , c1 BIGINT UNSIGNED);

INSERT INTO t1(time, c1) VALUES (1641024000000, NULL);
INSERT INTO t1(time, c1) VALUES (1641024000001, NULL);

# query 1
SELECT time, c1 FROM t1 WHERE NOT (c1 != 0);

# query 2
SELECT time, c1 FROM t1 WHERE NOT (c1 == 0);

Expected Behavior

Query 1 and Query 2 should return opposite results.

Actual behaviour

Both Query 1 and Query 2 can retrieve all the data.

Environment

  • OS:Ubuntu Server 22.04 LTS 64bit
  • TDengine Version:3.3.3.0

Additional Context

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

LingweiKuang avatar Oct 12 '24 04:10 LingweiKuang