[development] type(N) in MySQL numeric type defs in core schema useless

Sammy Spets sammys-drupal at synerger.com
Fri Aug 18 06:32:13 UTC 2006


Hi all,

I'm going through the core database code (as part of my role as 
PostgreSQL maintainer) and have stumbled upon an interesting tidbit.

The use of (N) declarations for integer types in CREATE TABLE statements 
is useless. From the MySQL manual:

"Another extension is supported by MySQL for optionally specifying the 
display width of an integer value in parentheses following the base 
keyword for the type (for example, INT(4)). This optional display width 
specification is used to left-pad the display of values having a width 
less than the width specified for the column.

The display width does not constrain the range of values that can be 
stored in the column, nor the number of digits that are displayed for 
values having a width exceeding that specified for the column."

Given that, why on earth are we even using them? I propose to strip the 
(N) declaration from core schema files. It'll provide a much quicker 
path between MySQL and PostgreSQL declarations.

Any complaints about this proposition?

Cheers,

-- 
Sammy Spets
Synerger Pty Ltd
http://www.synerger.com/



More information about the development mailing list