-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
fuzz/randomtestseverity/criticalsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE `t4e32b983` (
`col_29` tinyint(4) DEFAULT NULL,
UNIQUE KEY `idx_25` (`col_29`),
KEY `idx_26` (`col_29`),
UNIQUE KEY `idx_27` (`col_29`),
UNIQUE KEY `idx_28` (`col_29`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
PARTITION BY HASH (`col_29`) PARTITIONS 7;
INSERT INTO `t4e32b983` VALUES (-1), (11), (-128), (39), (-46), (38), (-102), (-99), (-87), (-127), (-89), (43), (108), (59), (0), (24), (101), (37), (-103), (90), (-95), (-44), (123), (124), (-123), (-52), (-49), (-98), (-104), (-68), (2), (-24), (67), (89), (1), (-65), (36), (-109), (41), (5), (98), (-63), (-14), (127), (-6), (121), (14), (-122);
select * from t4e32b983 where col_29 between -2 and 1;
2. What did you expect to see? (Required)
Three rows
mysql> select count(*) from (select col_29 between -2 and 1 as a from t4e32b983) t where a = 1;
+----------+
| count(*) |
+----------+
| 3 |
+----------+
1 row in set (0.00 sec)
3. What did you see instead (Required)
mysql> select * from t4e32b983 where col_29 between -2 and 1;
Empty set (0.01 sec)
mysql> select * from t4e32b983 where col_29 between -2 and 2;
+--------+
| col_29 |
+--------+
| 2 |
+--------+
1 row in set (0.00 sec)
mysql> select * from t4e32b983 where col_29 between -2 and 3;
+--------+
| col_29 |
+--------+
| 0 |
| 2 |
+--------+
2 rows in set (0.01 sec)
mysql> select * from t4e32b983 where col_29 between -2 and 4;
+--------+
| col_29 |
+--------+
| 2 |
| 0 |
| -1 |
| 1 |
+--------+
4 rows in set (0.01 sec)
4. What is your TiDB version? (Required)
Metadata
Metadata
Assignees
Labels
fuzz/randomtestseverity/criticalsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.