Skip Menu |

This queue is for tickets about the DBIx-DBSchema CPAN distribution.

Report information
The Basics
Id: 12300
Status: resolved
Priority: 0/
Queue: DBIx-DBSchema

People
Owner: Nobody in particular
Requestors: aorr76 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.26
Fixed in:
  • 0.27
  • 0.28
  • 0.29
  • 0.30
  • 0.31
  • 0.32
  • 0.33



Subject: mysql enum column type
Using the mysql driver, "enum" column types are not recognized and the module dies. A patch is included for the fix. Also, would also be nice if the module did not die on an unknown column type. My environment: Linux 2.4.18-3bigmem #1 SMP perl, v5.8.6 built for i686-linux DBIx::DBSchema::VERSION: 0.26 mysql Ver 14.7 Distrib 4.1.7, for pc-linux (i686) Regards, Andy Orr
--- mysql.pm.orig Thu Apr 14 17:18:38 2005 +++ mysql.pm Thu Apr 14 17:27:06 2005 @@ -38,5 +38,5 @@ $sth->execute or die $sth->errstr; map { - $_->{'Type'} =~ /^(\w+)\(?([\d\,]+)?\)?( unsigned)?$/ + $_->{'Type'} =~ /^(\w+)\(?(['"\w\d\,]+)?\)?( unsigned)?$/ or die "Illegal type: ". $_->{'Type'}. "\n"; my($type, $length) = ($1, $2);
[AORR - Fri Apr 15 09:07:37 2005]: Show quoted text
> Using the mysql driver, "enum" column types are not recognized and > the module dies. A patch is included for the fix.
Thanks for the patch! Applied to CVS; if you could test it out and let me know if it works for you that would be great. I tried to make the regex a little more permissable than yours; as far as I know enum types aren't limited to \w\d. You can download a snapshot at http://www.sisd.com/cgi-bin/viewcvs.cgi/DBIx-DBSchema/DBIx-DBSchema.tar.gz?tarball=1 Show quoted text
> Also, would also be nice if the module did not die on an unknown > column type.
What behaviour would you prefer?
From: AORR
[IVAN - Fri Apr 15 09:18:29 2005]: Show quoted text
> [AORR - Fri Apr 15 09:07:37 2005]: >
> > Using the mysql driver, "enum" column types are not recognized and > > the module dies. A patch is included for the fix.
> > Thanks for the patch! Applied to CVS; if you could test it out and > let me know if it works for you that would be great. I tried to make > the regex a little more permissable than yours; as far as I know enum > types aren't limited to \w\d. You can download a snapshot at > http://www.sisd.com/cgi-bin/viewcvs.cgi/DBIx-DBSchema/DBIx- > DBSchema.tar.gz?tarball=1
Thanks so much for the download! Show quoted text
> > Also, would also be nice if the module did not die on an unknown > > column type.
> > What behaviour would you prefer?
I'm using your module for a web based Mysql interface and it's been working great! When a table had a column with an enum type none of the columns were displayed. Never thought much of it, but after looking at the mysql driver, looked like an easy enough fix. I suppose "warn" would be better than "die" for an unknown column type? Thanks! Andy
[AORR - Fri Apr 15 10:14:10 2005]: Show quoted text
> [IVAN - Fri Apr 15 09:18:29 2005]:
> > [AORR - Fri Apr 15 09:07:37 2005]:
> > > > > > Also, would also be nice if the module did not die on an unknown > > > column type.
> > > > What behaviour would you prefer?
> > I'm using your module for a web based Mysql interface and it's been > working great! When a table had a column with an enum type none of > the columns were displayed. Never thought much of it, but after > looking at the mysql driver, looked like an easy enough fix. I > suppose "warn" would be better than "die" for an unknown column > type?
The problem is not an "unknown" column type - the problem is an _unparsable_ column type. The module handles unknown column types fine. I'm sorry, but in this context I don't think it would be useful to just warn and continue. The error is thrown because the column couldn't be parsed; it seems vastly less useful to "warn" and return bogus information than to throw an exception.
From: Bernhard.Schmalhofer [...] biomax.de
It looks like I have run into the same issue. I get a table without columns when I have something like CREATE TABLE `dummy_8` ( `state` enum('SUBMITTED','NOT_SUBMITTED') default 'NOT_SUBMITTED' ) in my schema.
this was fixed in 0.27