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

wrong result in statement "bit(1) in (0x30)" #22839

Closed
ChenPeng2013 opened this issue Feb 20, 2021 · 3 comments · Fixed by #22869
Closed

wrong result in statement "bit(1) in (0x30)" #22839

ChenPeng2013 opened this issue Feb 20, 2021 · 3 comments · Fixed by #22869
Assignees
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)


use test;
drop table if exists PK_1389;
CREATE TABLE `PK_1389` (
  `COL1` bit(1) NOT NULL,
  `COL2` varchar(20) DEFAULT NULL,
  `COL3` datetime DEFAULT NULL,
  `COL4` bigint(20) DEFAULT NULL,
  `COL5` float DEFAULT NULL,
  PRIMARY KEY (`COL1`)
);
insert into PK_1389 values(0, "皟钹糁泅埞礰喾皑杏灚暋蛨歜檈瓗跾咸滐梀揉", "7701-12-27 23:58:43", 4806951672419474695, -1.55652e38);
select * from PK_1389 where col1 = 0x30;
select * from PK_1389 where col1 in ( 0x30);

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

mysql 8.0.23

mysql> select * from PK_1389 where col1 = 0x30;
Empty set (0.05 sec)

mysql> select * from PK_1389 where col1 in ( 0x30);
Empty set (0.04 sec)

3. What did you see instead (Required)

mysql> select * from PK_1389 where col1 = 0x30;
Empty set (0.05 sec)

mysql> select * from PK_1389 where col1 in ( 0x30);
+------------+--------------------------------------------------------------+---------------------+---------------------+-------------+
| COL1       | COL2                                                         | COL3                | COL4                | COL5        |
+------------+--------------------------------------------------------------+---------------------+---------------------+-------------+
| 0x00       | 皟钹糁泅埞礰喾皑杏灚暋蛨歜檈瓗跾咸滐梀揉                     | 7701-12-27 23:58:43 | 4806951672419474695 | -1.55652e38 |
+------------+--------------------------------------------------------------+---------------------+---------------------+-------------+
1 row in set, 1 warning (0.04 sec)

mysql> show warnings;
+---------+------+----------------------------+
| Level   | Code | Message                    |
+---------+------+----------------------------+
| Warning | 1406 | Data Too Long, field len 1 |
+---------+------+----------------------------+
1 row in set (0.04 sec)

4. What is your TiDB version? (Required)

Release Version: v4.0.0-beta.2-2135-gd6a2b9a37-dirty
Edition: Community
Git Commit Hash: d6a2b9a372edd3638c0ed88e1d2a5e6b702a69ed
Git Branch: master
UTC Build Time: 2021-02-11 02:48:59
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@ChenPeng2013 ChenPeng2013 added the type/bug The issue is confirmed as a bug. label Feb 20, 2021
@ti-srebot
Copy link
Contributor

This issue contains Chinese, please use English.

@ti-srebot
Copy link
Contributor

ti-srebot commented Mar 9, 2021

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

[v4.0.0:v4.0.11],[v5.0.0-rc]

6. Fixed versions

master

@ti-srebot
Copy link
Contributor

( FixedVersions ) fields are empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants