[Bast-commits] r8497 - in DBIx-Class/0.08/trunk: lib/DBIx/Class/Storage/DBI/Oracle t

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Mon Feb 1 11:07:13 GMT 2010


Author: caelum
Date: 2010-02-01 11:07:13 +0000 (Mon, 01 Feb 2010)
New Revision: 8497

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
   DBIx-Class/0.08/trunk/t/73oracle.t
Log:
throw exception on attempt to insert a blob with DBD::Oracle == 1.23

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm	2010-02-01 10:09:07 UTC (rev 8496)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm	2010-02-01 11:07:13 UTC (rev 8497)
@@ -252,6 +252,13 @@
     my %column_bind_attrs = $self->bind_attribute_by_data_type($data_type);
 
     if ($data_type =~ /^[BC]LOB$/i) {
+      if ($DBD::Oracle::VERSION eq '1.23') {
+        $self->throw_exception(
+"BLOB/CLOB support in DBD::Oracle == 1.23 is broken, use an earlier or later ".
+"version"
+        );
+      }
+
       $column_bind_attrs{'ora_type'} = uc($data_type) eq 'CLOB'
         ? DBD::Oracle::ORA_CLOB()
         : DBD::Oracle::ORA_BLOB()

Modified: DBIx-Class/0.08/trunk/t/73oracle.t
===================================================================
--- DBIx-Class/0.08/trunk/t/73oracle.t	2010-02-01 10:09:07 UTC (rev 8496)
+++ DBIx-Class/0.08/trunk/t/73oracle.t	2010-02-01 11:07:13 UTC (rev 8497)
@@ -229,9 +229,6 @@
 is($st->pkid1, 55, "Oracle Auto-PK without trigger: First primary key set manually");
 
 SKIP: {
-  skip 'buggy BLOB support in DBD::Oracle 1.23', 8
-    if $DBD::Oracle::VERSION == 1.23;
-
   my %binstr = ( 'small' => join('', map { chr($_) } ( 1 .. 127 )) );
   $binstr{'large'} = $binstr{'small'} x 1024;
 
@@ -242,6 +239,14 @@
   my $rs = $schema->resultset('BindType');
   my $id = 0;
 
+  if ($DBD::Oracle::VERSION eq '1.23') {
+    throws_ok { $rs->create({ id => 1, blob => $binstr{large} }) }
+      qr/broken/,
+      'throws on blob insert with DBD::Oracle == 1.23';
+
+    skip 'buggy BLOB support in DBD::Oracle 1.23', 7;
+  }
+
   foreach my $type (qw( blob clob )) {
     foreach my $size (qw( small large )) {
       $id++;




More information about the Bast-commits mailing list