As you rightly quoted from the MySQL manual :
Quote:
M indicates the maximum display width for integer types
|
This means that any integer number that displays BELOW this width (as example: 4) will be padded with spaces (or if zerofill specified 0's) ,
Code:
CREATE TABLE testTable (
`a` INT(4),
`b` INT(4) ZEROFILL
);
INSERT INTO testTable (`a`, `b`)
VALUES (1, 1)
,(12,12)
,(123,123)
,(1234,1234)
,(12345,12345);
will actually be producing :
Code:
a || b
=============
1 || 0001
12 || 0012
123 || 0123
1234 || 1234
12345 || 12345
note in column `a` you have 3,2,1,0,0 spaces in front of your number