← Back to team overview

maria-discuss team mailing list archive

Re: int(x) does nothing


Hi Richard,

On 15May , 2013, at 14:35, Richard Couture <rrc@xxxxxxxxxxxxxx> wrote:

> We discovered that declaring an int(x) of x characters does not seem to impose any restrictions what-so-ever on the size of data that can be stored in that int. Storing an int of greater dimension than that which was declared does NOT even generate a warning.
> Can someone please tell us why we are allowed to make such declarations and what are there purposes?

Please see http://dev.mysql.com/doc/refman/5.5/en/numeric-type-attributes.html

The "attribute" you can put in parentheses to integer types in MySQL/MariaDB is just used optionally for display purposes in client programs. It imposes no limitations on the data that can be stored in or retrieve from the column.