Hi,
I'm trying to get some work on an Oracle DB layer and face some odd (at least for me) behaviour from MySQL.
MySQL doesn't constrains the range of values that can be stored in a column.
We have a good example of this in the MySQL Drupal Schema :
CREATE TABLE menu (
mid int(10) unsigned NOT NULL default '0',
pid int(10) unsigned NOT NULL default '0',
path varchar(255) NOT NULL default '',
title varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
weight tinyint(4) NOT NULL default '0',
type int(2) unsigned NOT NULL default '0',
PRIMARY KEY (mid)
) TYPE=MyISAM;
INSERT INTO menu VALUES (2, 0, '', 'Primary links', '', 0, 115);
So am I the only one bothered by such things ?
Should we better remove all kind of numeric value size as it's pretty useless ?
In fact PgSQL schema came without these limits, so I think I would go this way.
Any thoughts ?
From MySQL doc (http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html)
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.