Bug #76322 permit varchar(65533) even for utf8 charset
Submitted: 14 Mar 2015 12:21
Reporter: Dan O'Brien Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Charsets Severity:S4 (Feature request)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[14 Mar 2015 12:21] Dan O'Brien
Description:
Currently for utf8 and varchar the maximum size is 21,844 due to the fact that utf8 may require up to 3 bytes per character.  However suppose you have strings that contain mostly ascii requiring only one byte in utf8 and only a few multibyte characters. This is probable a common occurrence in practice.  For example in on application I am working on we store text documents with less then 40000 characters most of which are ascii and would easily fit in the 65533 limit for the row.   

How to repeat:
CREATE TABLE test.TableMaxNvarchar1(
	xnvarcharMax VARCHAR(65533) charset utf8   not null
);

Suggested fix:
Allow the max to be 65533 even for any character encoding.