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

insert ignore cast invalid data to bit is not compatible with MySQL #24284

Closed
aytrack opened this issue Apr 26, 2021 · 2 comments
Closed

insert ignore cast invalid data to bit is not compatible with MySQL #24284

aytrack opened this issue Apr 26, 2021 · 2 comments
Labels
severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug. type/stale This issue has not been updated for a long time.

Comments

@aytrack
Copy link
Contributor

aytrack commented Apr 26, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t03(a int, b bit(1), primary key (a, b));
insert ignore into t03 values (1, 0x30);

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

mysql> insert ignore into t03 values (1, 0x30);
Query OK, 1 row affected, 1 warning (0.09 sec)

mysql> select * from t03;
+---+------+
| a | b    |
+---+------+
| 1 | 0x01 |
+---+------+
1 row in set (0.14 sec)
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.23    |
+-----------+
1 row in set (0.07 sec)

3. What did you see instead (Required)

mysql> insert ignore into t03 values (1, 0x30);
Query OK, 1 row affected, 1 warning (0.26 sec)

mysql> select * from t03;
+---+------+
| a | b    |
+---+------+
| 1 | 0x00 |
+---+------+
1 row in set (0.10 sec)

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                                  |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-2707-g6889ab44a-dirty
Edition: Community
Git Commit Hash: 6889ab44a5bf21ec0465cd84a4baf68072f1bd3c
Git Branch: master
UTC Build Time: 2021-04-22 13:12:44
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.25 sec)

@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/major labels Apr 26, 2021
@ichn-hu
Copy link
Contributor

ichn-hu commented May 10, 2021

@aytrack this incompatibility is caused by invalid parameter, and there is no apparent reason why b should be 0x01, so I would say this should be a minor bug, please help change the label if you agree.

@jebter
Copy link

jebter commented Jun 25, 2024

TiDB [email protected]:test> create table t03(a int, b bit(1), primary key (a, b));
Query OK, 0 rows affected
Time: 0.076s
TiDB [email protected]:test> insert ignore into t03 values (1, 0x30);
Query OK, 1 row affected
Time: 0.002s
TiDB [email protected]:test> select * from t03;
+---+------+
| a | b    |
+---+------+
| 1 | 0x01 |
+---+------+

1 row in set
Time: 0.004s
TiDB [email protected]:test> select tidb_version() \G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v8.1.0
Edition: Community
Git Commit Hash: 945d07c5d5c7a1ae212f6013adfb187f2de24b23
Git Branch: HEAD
UTC Build Time: 2024-05-21 03:52:40
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv

1 row in set
Time: 0.001s

Please try the latest version.I will close it, if there are any updates, you can reopen it.

@jebter jebter closed this as completed Jun 25, 2024
@jebter jebter added the type/stale This issue has not been updated for a long time. label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug. type/stale This issue has not been updated for a long time.
Projects
None yet
Development

No branches or pull requests

3 participants