dolthub / dolthub/dolt

Unexpected and incorrect `is too large for column` error

Closed
#5,942 0 comments 0 reactions 1 assignee Claimed by @zachmu View on GitHub
bad error message bug correctness sql
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 9h
Merged PRs (30d)
121

Description

Setup:
```sql
use db;
CREATE TABLE `django_session` (
`session_key` varchar(5) PRIMARY KEY
);
SELECT * FROM django_session WHERE (session_key = '0123456789');```

MySQL response is no data, but also no errors.

Dolt response:
```txt
SELECT * FROM django_session WHERE (session_key = '0123456789') LIMIT 21: string '0123456789' is too large for column 'varchar(5)'
string '0123456789' is too large for column 'varchar(5)'
```

Two problems:
1. Dolt throws an error, while MySQL does not
2. The Dolt error does not include the actual name of the column

Also, it looks like this is only a problem for primary keys. If you remove `PRIMARY KEY` from the table definition, both dolt and MySQL return no data and no errors.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.