pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.2k stars 5.84k forks source link

mvcc: [types:1406]Data Too Long, field len 12, data len 26% #54865

Open GMHDBJD opened 3 months ago

GMHDBJD commented 3 months ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

> mysql -h127.0.0.1 -uroot -P4000
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4253024264
Server version: 8.0.11-TiDB-v8.2.0-alpha-10-gcfbabfa TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database db;
Query OK, 0 rows affected (0.17 sec)

mysql> use db;
Database changed
mysql> create table tb(a binary(12) not null, b int(11) not null, primary key(a,b));
Query OK, 0 rows affected (0.18 sec)

mysql> insert into tb values(0xAAAAAAAAAAAAAAAAAAAAAAAA,0);
Query OK, 1 row affected (0.01 sec)

mysql> exit
Bye
> curl http://127.0.0.1:10080/mvcc/key/db/tb\?a\=0xAAAAAAAAAAAAAAAAAAAAAAAA\&b\=0\;
[types:1406]Data Too Long, field len 12, data len 26%                                           

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

get mvcc for the key

3. What did you see instead (Required)

[types:1406]Data Too Long, field len 12, data len 26%                                           

4. What is your TiDB version? (Required)

nightly

zyguan commented 2 days ago

Not an issue, curl 'http://127.0.0.1:10080/mvcc/key/db/tb?a=%AA%AA%AA%AA%AA%AA%AA%AA%AA%AA%AA%AA&b=0' is the correct command for getting the mvcc.