Why can't I insert 10 digits when my column is INT(10)

后端 未结 6 1733
孤独总比滥情好
孤独总比滥情好 2021-01-17 05:24

I have this column that\'s INT(10) ZEROFILL NOT NULL DEFAULT \'0000000000\',

But when I insert something like 9100000010, I get 42949

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-17 05:57

    I belive you get int max value. INT(10) is ment for number padding not for limiting number of characters.

    MySQL will try to pad these values with spaces/zeroes when returning them.

提交回复
热议问题