[Dbix-class] Small patch for DBIx::Class::Storage::DBI::Oracle::Generic (BLOB handling)

Matt S Trout dbix-class at trout.me.uk
Thu May 29 07:07:52 BST 2008


On Fri, May 16, 2008 at 12:35:29AM +0400, Nickolay Platonov wrote:
> Hello
> 
> I've discovered the issue with BLOB column handling with
> DBIx::Class::Storage::DBI::Oracle::Generic
> (the column value doesnt want to go into base)
> 
> the key links:
> 
> http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Binding_for_Updates_and_Inserts<http://search.cpan.org/%7Epythian/DBD-Oracle-1.21/Oracle.pm#Binding_for_Updates_and_Inserts>
> http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Placeholder_Binding_Attributes<http://search.cpan.org/%7Epythian/DBD-Oracle-1.21/Oracle.pm#Placeholder_Binding_Attributes>
> 
> http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/Storage/DBI.pm#bind_attribute_by_data_type<http://search.cpan.org/%7Eash/DBIx-Class-0.08010/lib/DBIx/Class/Storage/DBI.pm#bind_attribute_by_data_type>
> 
> And here is a suggesting quick patch, based on info from links:
> 
> 
> use DBD::Oracle qw(:ora_types);
> 
> 
> sub bind_attribute_by_data_type {
>     my ($self,$type) = @_;
> 
>     if ($type eq 'BLOB') {
>         return { 'ora_type' => SQLT_BIN };
>     } elsif ($type eq 'CLOB') {
>         return { 'ora_type' => SQLT_CHR };
>     } else {
>         return;
>     }
> }

That looks pretty sane. Could you see about adding something to the oracle
tests to "prove" this works (and let people with different versions verify it)
and then I'll sort you out a commit bit?

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list