MySQL int definition explanation

For many years, I was under the assumption that I was creating a new bigint (12) column for a MySQL table in which the field is limited to integers up to 12 digits. However, I recently noticed that values ​​of up to 16 digits can be written and selected from a column other than bigint (12) without any warnings or problems.

Can someone please help me understand why this is so and what this column definition means? Thanks in advance!

+3
source share
2 answers

bigint (12) doesn't truncate at all. 12 are used for display.

See Numeric Types

Numeric type attributes

MySQL base . , INT (4) INT . , , , . ( , . .)

, . , .

+5

Numeric Type Attributes MySql INT (4) INT

+2

Source: https://habr.com/ru/post/1778061/


All Articles