According to the documentation, the attribute in the parentheses (e.g. the “3” in SMALLINT(3)) is supposed to constrain the display of the values of the SMALLINT to three digits. However, when I inserted five test numbers (9, 99, 999, 9999, 99999), it took each number at its full value rather than capping it at the three digits and displayed it accordingly (except for 99999, of course, which it capped at 32767). Shouldn’t the numbers be limited, at least while being displayed, to three digits? Or am I missing the true purpose here?
According to the documentation, the attribute in the parentheses (e.g. the 3 in SMALLINT(3))
Share
For integer types, the attribute relates to display width and can only be seen if you add zerofill to the column create statement.
Display width does not effect the storage allocated to the column, only the padded display when zerofill is enabled.
See also this explanation: http://matthom.com/archive/2006/11/28/mysql-integer-columns-and-display-width