You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
DROPTABLE IF EXISTS t0;
DROPTABLE IF EXISTS t1;
CREATETABLEt0(c0 CHAR);
CREATETABLEt1LIKE t0;
INSERT INTO t0 VALUES ('4');
INSERT INTO t1 VALUES ('1');
SELECTCOUNT(*) FROM t1, t0 WHERE NOT (0.7) > (CAST(t1.c0AS YEAR));
SELECT (CAST(t1.c0AS YEAR)) FROM t1;
2. What did you expect to see? (Required)
see the following case:
3. What did you see instead (Required)
// MySQL 8.4.1
MySQL [test]>SELECTCOUNT(*) FROM t1, t0 WHERE NOT (0.7) > (CAST(t1.c0AS YEAR));
+----------+
| COUNT(*) |
+----------+
| 1 |
+----------+1 row inset (0.00 sec)
MySQL [test]>SELECT (CAST(t1.c0AS YEAR)) FROM t1;
+-----------------------+
| (CAST(t1.c0AS YEAR)) |
+-----------------------+
| 2001 |
+-----------------------+1 row inset (0.00 sec)
// TiDB
mysql>SELECTCOUNT(*) FROM t1, t0 WHERE NOT (0.7) > (CAST(t1.c0AS YEAR));
+----------+
| COUNT(*) |
+----------+
| 0 |
+----------+1 row inset (0.04 sec)
mysql>SELECT (CAST(t1.c0AS YEAR)) FROM t1;
+-----------------------+
| (CAST(t1.c0AS YEAR)) |
+-----------------------+
| 1 |
+-----------------------+1 row inset (0.03 sec)
// Interestingly, if I change '>' to '>=', this SQL can execute correctly
mysql>SELECTCOUNT(*) FROM t1, t0 WHERE NOT (0.7) >= (CAST(t1.c0AS YEAR));
+----------+
| COUNT(*) |
+----------+
| 1 |
+----------+1 row inset (0.05 sec)
4. What is your TiDB version? (Required)
TiDB v8.5.0
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
see the following case:
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
TiDB v8.5.0
The text was updated successfully, but these errors were encountered: