pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.55k stars 5.75k forks source link

Incorrect query result #44241

Open sayJason opened 1 year ago

sayJason commented 1 year ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 FLOAT UNSIGNED UNIQUE);
INSERT INTO t1 VALUES (1);
SELECT c1 FROM t1 WHERE '1e500' != c1; -- actual: error, expected: {1}
-- [22003][1690] constant 1.7976931348623157e+308 overflows float

2. What did you expect to see? (Required)

SELECT returns 1

3. What did you see instead (Required)

SELECT returns an error, with message "[22003][1690] constant 1.7976931348623157e+308 overflows float"

4. What is your TiDB version? (Required)

Release Version: v7.0.0 Edition: Community Git Commit Hash: 7376954cd868dbc44fc3015c9ef89c53749339a7 Git Branch: heads/refs/tags/v7.0.0 UTC Build Time: 2023-03-29 13:32:13 GoVersion: go1.20.2 Race Enabled: false TiKV Min Version: 6.2.0-alpha Check Table Before Drop: false Store: tikv

sayJason commented 1 year ago

I tried the same case in MySQL8, which returns the value 1.