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
mysql> show create table t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`c1` int DEFAULT NULL,
`c2` int DEFAULT NULL
) ENGINE=WARP DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.01 sec)
mysql> select c1, count(*) From t1 group by c1;
+------+----------+
| c1 | count(*) |
+------+----------+
| 1 | 524288 |
+------+----------+
1 row in set (0.20 sec)
-- left hand side on int compare to int works
mysql> select count(*) from t1 where 0 = c1;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.03 sec)
-- left hand side on int compare to int works
mysql> select count(*) from t1 where 1 = c1;
+----------+
| count(*) |
+----------+
| 524288 |
+----------+
1 row in set (0.12 sec)
-- left hand side on string compare to int does not work
-- wrong result!
mysql> select count(*) from t1 where '0' = c1;
+----------+
| count(*) |
+----------+
| 524288 |
+----------+
1 row in set (0.13 sec)
Right hand side to string comparisons work properly:
mysql> select count(*) from t1 where c1 = '0';
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.02 sec)
mysql> select count(*) from t1 where c1 = '1';
+----------+
| count(*) |
+----------+
| 524288 |
+----------+
1 row in set (0.12 sec)
mysql> select count(*) from t1 where c1 > '1';
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.02 sec)
mysql> select count(*) from t1 where c1 > '0';
+----------+
| count(*) |
+----------+
| 524288 |
+----------+
1 row in set (0.12 sec)
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: