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.