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

Convert from VARCHAR/CHAR to BIT doesn't behave well #57312

Closed
YangKeao opened this issue Nov 12, 2024 · 1 comment · Fixed by #57303
Closed

Convert from VARCHAR/CHAR to BIT doesn't behave well #57312

YangKeao opened this issue Nov 12, 2024 · 1 comment · Fixed by #57303
Labels
affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/expression severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@YangKeao
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> create table t (a bit(32));
Query OK, 0 rows affected (0.05 sec)

mysql> insert into t values ('b\'1\'');
Query OK, 1 row affected (0.01 sec)

mysql> select * from t;
+------------+
| a          |
+------------+
| 0x00000001 |
+------------+
1 row in set (0.00 sec)

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

mysql> insert into t values ('b\'1\'');
Query OK, 1 row affected (0.00 sec)

mysql> select * from t;
+------------+
| a          |
+------------+
| 0x62273127 |
+------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

v8.3.0.

This bug is introduced by #21310

@YangKeao
Copy link
Member Author

In MySQL, even in LOAD DATA, the b'1' is not parsed. I don't know why it's implemented as Parse in #21310

@YangKeao YangKeao added sig/execution SIG execution severity/major affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. labels Nov 12, 2024
@ti-chi-bot ti-chi-bot bot added the may-affects-5.4 This bug maybe affects 5.4.x versions. label Nov 12, 2024
@YangKeao YangKeao added component/expression affects-5.4 This bug affects the 5.4.x(LTS) versions. and removed may-affects-5.4 This bug maybe affects 5.4.x versions. labels Nov 12, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 95b04c7 Nov 12, 2024
ti-chi-bot bot pushed a commit that referenced this issue Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/expression severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
1 participant