pingcap / pingcap/tidb

import into: base64 encoded NULL values can't be imported into varbinary(1) column

Open
#60,099 0 comments 0 reactions 1 assignee Claimed by @D3Hunter View on GitHub
component/ddl may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)
```shell
(base) ➜ ~ cat base64null.csv
XE4=
```

```sql
create table t(a varbinary(1));

import into t from "/Users/fanzhou/base64null.csv" with fields_encoded_by='base64', fields_enclosed_by='', fields_escaped_by='', character_set='binary';

mysql> show import jobs where job_id = 3\G;
*************************** 1. row ***************************
Job_ID: 3
Data_Source: /Users/fanzhou/base64null.csv
Target_Table: `test`.`t`
Table_ID: 110
Phase: importing
Status: awaiting-resolution
Source_File_Size: 5B
Imported_Rows: 0
Result_Message: [types:1406]Data Too Long, field len 1, data len 2
Create_Time: 2025-03-17 09:45:55.113214
Start_Time: 2025-03-17 09:45:55.624219
End_Time: NULL
Created_By: root@%
1 row in set (0.01 sec)
```

### 2. What did you expect to see? (Required)
Import into success
### 3. What did you see instead (Required)
Import into stuck
### 4. What is your TiDB version? (Required)
**Not master.**
https://github.com/pingcap/tidb/tree/feature/release-8.1-gsort-test
```
mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.1.2-42-g14ea5f3db54
Edition: Community
Git Commit Hash: 14ea5f3db54b197393b5efbb104ba5779ad21c96
Git Branch: feature/release-8.1-gsort-test
UTC Build Time: 2025-03-15 10:41:12
GoVersion: go1.23.6
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.