Bug #32526 TEXT(8192) works, but not documented how it works?
Submitted: 20 Nov 2007 14:37 Modified: 20 Nov 2007 14:45
Reporter: Geert Vanderkelen Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.0.48,5.1.22 OS:Any
Assigned to: CPU Architecture:Any

[20 Nov 2007 14:37] Geert Vanderkelen
Description:
Executing the following works:
  CREATE TABLE t1 (id INT, t TEXT(8192));

It will give no syntax error, and TEXT(8192) will become TEXT. If bigger a bigger 'size' is given, it will be becoming MEDIUMTEXT or LONGTEXT. So it acts as a hint.

However, based on the CREATE TABLE documentation, it should actually _not_ work:
  http://dev.mysql.com/doc/refman/5.1/en/create-table.html
(or it's doc'ed anywhere else?)

IMHO, it is quite confusing what the 'size' of TEXT and BLOB fields is. It is a hint and it will pick an appropriated field type, but most will think that it is really the max size.

How to repeat:
mysql> CREATE TABLE t1 (id INT, t TEXT(8192));
mysql> SHOW CREATE TABLE t1;

Suggested fix:
Fix at least the documentation.
[20 Nov 2007 14:45] Geert Vanderkelen
Documented here:
  http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html

Not on the CREATE TABLE stuff..