WL#13127: Deprecate integer display width and ZEROFILL option

Affects: Server-8.0   —   Status: Complete

Deprecate the ZEROFILL attribute for numeric data types and the display width
attribute for integer types.

ZEROFILL and display width do not affect the storage size of the data type, only
the display width. How the numbers are displayed, can be controlled by other
means. For example, applications could use the LPAD function to zero-pad numbers
up to the desired width, or they could store the formatted numbers in CHAR columns.

See also:
http://www.tocker.ca/2015/07/02/proposal-to-deprecate-mysql-integer-display-width-and-zerofill.html
F-1: Creating a table with a column that has the ZEROFILL attribute shall give a
warning.

F-2: Creating a table with a TINYINT, SMALLINT, MEDIUMINT, INT or BIGINT column
that has an explicit display width shall give a warning.

F-3: Adding a column with the ZEROFILL attribute to an existing table shall give
a warning.

F-4: Adding a TINYINT, SMALLINT, MEDIUMINT, INT or BIGINT column that has an
explicit display width, to an existing table, shall give a warning.

F-5: Modifying an existing column to make it a numeric column with the ZEROFILL
attribute shall give a warning.

F-6: Modifying an existing column to make it a TINYINT, SMALLINT, MEDIUMINT, INT
or BIGINT column with an explicit display width shall give a warning.

F-7: Declaring a variable, parameter or return type with the ZEROFILL attribute
in a stored routine shall give a warning.

F-8: Declaring a variable, parameter or return type as TINYINT, SMALLINT,
MEDIUMINT, INT or BIGINT with an explicit display width in a stored routine
shall give a warning.

The deprecation warnings are:

"The ZEROFILL attribute is deprecated and will be removed in a future release.
Use the LPAD function to zero-pad numbers, or store the formatted numbers in a
CHAR column."

"Integer display width is deprecated and will be removed in a future release."
The warnings will be raised by the parser whenever a type specification contains
an integer display width or ZEROFILL attribute.

Additionally, CREATE TABLE AS and CREATE TABLE LIKE will check the column
definitions in the source table and raise a warning if any of the source columns
has the ZEROFILL attribute. They will not raise warnings about integer display
width, because

a) It cannot be reliably determined whether the integer display width was
specified explicitly in the source table, or if it was implicit.

b) For CREATE TABLE AS and CREATE TABLE LIKE, removal of support for integer
display width won't have any compatibility consequences unless the column has
the ZEROFILL attribute. If the ZEROFILL attribute is specified, a warning is
already raised about the ZEROFILL attribute, so the user is notified that there
is a potential compatibility issue, regardless of whether we raise another
warning for integer display width.