Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cast as binary does not behave correctly when data is NaN #3443

Open
birdstorm opened this issue Nov 16, 2021 · 2 comments
Open

cast as binary does not behave correctly when data is NaN #3443

birdstorm opened this issue Nov 16, 2021 · 2 comments

Comments

@birdstorm
Copy link
Contributor

birdstorm commented Nov 16, 2021

mysql> select /*+ READ_FROM_STORAGE(TIflash[t]) */ * from t where binary(c)='NaN';

+-------+
|   c   |
+-------+
|  NaN  |
+-------+
1 row in set (0.00 sec)

mysql> select /*+ READ_FROM_STORAGE(tikv[t]) */ * from t where binary(c)='NaN';
Empty set (0.01 sec)

v4.0.9

@birdstorm birdstorm added component/expression type/bug The issue is confirmed as a bug. labels Nov 16, 2021
@leowangpingcap
Copy link

hi,
actually not just binary,
hex casting has the issue too, wondering if other types also can have this inconsistency behaviour:

mysql> select c, c = 0, hex(c), binary(c) from t;
+------+-------+------------------+----------------------+
| c | c = 0 | hex(c) | binary(c) |
+------+-------+------------------+----------------------+
| 0 | 0 | 8000000000000000 | 0x4E614E |
| 0 | 1 | 0 | 0x30 |
+------+-------+------------------+----------------------+
2 rows in set (0.01 sec)

able to reproduce in 5.1 and 5.2

@fuzhe1989
Copy link
Contributor

fuzhe1989 commented Nov 23, 2021

@leowangpingcap could you tell me what values were inserted into table t? I can't tell the difference of the values of c in row1 and row2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants