Subject: | Incorrect handling of signed/unsigned number in mysql driver |
Date: | Fri, 9 Nov 2007 13:16:01 +0000 |
To: | bug-DBIx-DBSchema [...] rt.cpan.org |
From: | "Gudmundur A. Thorisson" <gthorisson [...] gmail.com> |
Hi there. I want to report a problem in DBIx::DBSchema::DBD::mysql,
latest version (0.35). When iterating over the columns in a table,
the driver ignores the fact that numeric columns can have the
unsigned attribute (e.g. int(10) unsigned ) . Here's a sample table-
definition and the change to the regexp in line 45 in mysql.pm that
makes it work with my schema:
CREATE TABLE `Marker` (
`AutoMarkerID` int(10) unsigned NOT NULL auto_increment,
`MarkerID` varchar(15) default NULL COMMENT 'HGVbase-assigned
identifier for the marker',
`IsDead` char(1) default NULL COMMENT 'Flag for specifying whether
marker is deleted or not',
`VariationType` varchar(30) NOT NULL COMMENT 'SO term for the type
of the marker feature',
`Source` varchar(20) NOT NULL,
`LocalID` varchar(20) NOT NULL,
`HotlinkID` int(10) unsigned default NULL,
`ValidationCode` tinyint(2) unsigned default NULL COMMENT '0 to
31, as in ValidationCode table',
PRIMARY KEY (`AutoMarkerID`),
UNIQUE KEY `SourceDB` (`Source`,`LocalID`),
UNIQUE KEY `MarkerID` (`MarkerID`),
KEY `VariationType` (`VariationType`),
KEY `HotlinkID` (`HotlinkID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
45c45
< $_->{'Type'} =~ /^(\w+)\(?([^)]+)?\)?( \d+)?/
---
Show quoted text
> $_->{'Type'} =~ /^(\w+)\(?([^)]+)?\)?( \d+)?$/
Mummi
-----------------------------------------------------------
Gudmundur A. Thorisson, PhD student, Brookes lab
Department of Genetics
University of Leicester
University Road
Leicester, LE1 7RH, UK
E-mail: gthorisson@gmail.com
Tel: +44 (0)116 252-3055