Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 42281
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: Nobody in particular
Requestors: RADEK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.04003
  • 0.04004
  • 0.04005
Fixed in: (no value)



Subject: [patch] Oracle: work around DBD::Oracle's failure to SELECT an XMLTYPE column
DBD::Oracle is unable to SELECT a column of type XMLTYPE, therefore a discovery attempt on a schema with such a column will fail; see https://rt.cpan.org/Ticket/Display.html?id=42280 Attached a patch to use DBI->column_info() instead of "SELECT *".
Subject: perl-DBIx-Class-Schema-Loader-ora_xmltype.patch
--- DBIx-Class-Schema-Loader-0.04003/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm 2007-10-04 15:09:52.000000000 +0200 +++ DBIx-Class-Schema-Loader-0.04003/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm 2009-01-10 15:00:48.612905271 +0100 @@ -37,9 +37,8 @@ my $dbh = $self->schema->storage->dbh; - my $sth = $dbh->prepare($self->schema->storage->sql_maker->select($table, undef, \'1 = 0')); - $sth->execute; - return \@{$sth->{NAME_lc}}; + my $sth = $dbh->column_info(undef, $self->db_schema, $table, 'TABLE,VIEW'); + return [ map lc, keys %{ $sth->fetchall_hashref('COLUMN_NAME') } ]; } sub _tables_list {
My previous patch is totally wrong. Attaching a working one; however, it uses "uc" at one point, as the $table argument seems to be case sensitive (and is being lc()'d in the _tables_list() method)...
Actually attaching the fixed patch.
--- DBIx/Class/Schema/Loader/DBI/Oracle.pm~ 2008-04-05 02:24:26.000000000 +0200 +++ DBIx/Class/Schema/Loader/DBI/Oracle.pm 2009-01-10 16:28:01.878928536 +0100 @@ -47,9 +47,8 @@ my $dbh = $self->schema->storage->dbh; - my $sth = $dbh->prepare($self->schema->storage->sql_maker->select($table, undef, \'1 = 0')); - $sth->execute; - return \@{$sth->{NAME_lc}}; + my $sth = $dbh->column_info(undef, $self->db_schema, uc $table, '%'); + return [ map lc, keys %{ $sth->fetchall_hashref('COLUMN_NAME') } ]; } sub _tables_list {
Fixed in git://git.shadowcat.co.uk/dbsrgits/DBIx-Class-Schema-Loader.git .