pingcap / pingcap/tidb

In the `SQL_mode = 'NO_ENGINE_SUBSTITUTION`, column length out of range error message has a problem

Open
#35,651 1 comment 0 reactions 1 assignee Claimed by @ymkzpx View on GitHub
severity/minor sig/sql-infra 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)

```
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
CREATE TABLE t1 (a varchar(70000) default "hello");
```

### 2. What did you expect to see? (Required)
`ERROR 1074 (42000): Column length too big for column 'a' (max = 16383); use BLOB or TEXT instead`

### 3. What did you see instead (Required)
`ERROR 1101 (42000): BLOB/TEXT/JSON column 'a' can't have a default value`

### 4. What is your TiDB version? (Required)

```
dition: Community
Git Commit Hash: a5d6db20d7982cff4a8fc963c198c0fad864a05e
Git Branch: master
UTC Build Time: 2022-06-16 04:10:08
GoVersion: go1.18.1
```

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.