Sammy Spets wrote:
> 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.

CommentFileSizeAuthor
#1 mysqlint.patch53.17 KBChris Johnson
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chris Johnson’s picture

Status: Active » Needs review
FileSize
53.17 KB

Here's a patch against current HEAD as of 18Aug2006 2114UTC.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Nice.

Robrecht Jacques’s picture

Small question: do the tables need to be updated in hook_update_X()? Eg with an ALTER TABLE to remove it from already existing table schemes. Or doesn't it matter at all that it is there or not?

sammys’s picture

It doesn't matter if they're there actually. For completeness sake they can be removed.

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

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)