Revert 2c2bc4e5 - it is entirely superseded by cb551b07, 2baba3d9 and 83eef562
[dbsrgits/DBIx-Class.git] / t / 73oracle_blob.t
index ae5a359..55b1daf 100644 (file)
@@ -9,7 +9,6 @@ use DBIx::Class::Optional::Dependencies ();
 
 use lib qw(t/lib);
 use DBICTest;
-use DBIC::SqlMakerTest;
 
 my ($dsn,  $user,  $pass)  = @ENV{map { "DBICTEST_ORA_${_}" }  qw/DSN USER PASS/};
 
@@ -60,7 +59,7 @@ SKIP: {
   my %binstr = ( 'small' => join('', map { chr($_) } ( 1 .. 127 )) );
   $binstr{'large'} = $binstr{'small'} x 1024;
 
-  my $maxloblen = (length $binstr{'large'}) + 5;
+  my $maxloblen = (length $binstr{'large'}) + 6;
   note "Localizing LongReadLen to $maxloblen to avoid truncation of test data";
   local $dbh->{'LongReadLen'} = $maxloblen;
 
@@ -78,21 +77,16 @@ SKIP: {
               . ': https://rt.cpan.org/Ticket/Display.html?id=64206'
     if $q;
 
-  # so we can disable BLOB mega-output
-  my $orig_debug = $schema->storage->debug;
-
   my $id;
   foreach my $size (qw( small large )) {
     $id++;
 
-    local $schema->storage->{debug} = $size eq 'large'
-      ? 0
-      : $orig_debug
-    ;
+    local $schema->storage->{debug} = 0
+      if $size eq 'large';
 
     my $str = $binstr{$size};
     lives_ok {
-      $rs->create( { 'id' => $id, blob => "blob:$str", clob => "clob:$str" } )
+      $rs->create( { 'id' => $id, blob => "blob:$str", clob => "clob:$str", blob2 => "blob2:$str", clob2 => "clob2:$str" } )
     } "inserted $size without dying";
 
     my %kids = %{$schema->storage->_dbh->{CachedKids}};
@@ -105,6 +99,8 @@ SKIP: {
     is @objs, 1, 'One row found matching on both LOBs';
     ok (try { $objs[0]->blob }||'' eq "blob:$str", 'blob inserted/retrieved correctly');
     ok (try { $objs[0]->clob }||'' eq "clob:$str", 'clob inserted/retrieved correctly');
+    ok (try { $objs[0]->clob2 }||'' eq "clob2:$str", "clob2 inserted correctly");
+    ok (try { $objs[0]->blob2 }||'' eq "blob2:$str", "blob2 inserted correctly");
 
     {
       local $TODO = '-like comparison on blobs not tested before ora 10 (fails on 8i)'
@@ -129,13 +125,15 @@ SKIP: {
 
     lives_ok {
       $rs->search({ id => $id, blob => "blob:$str", clob => "clob:$str" })
-        ->update({ blob => 'updated blob', clob => 'updated clob' });
+        ->update({ blob => 'updated blob', clob => 'updated clob', clob2 => 'updated clob2', blob2 => 'updated blob2' });
     } 'blob UPDATE with blobs in WHERE clause survived';
 
     @objs = $rs->search({ blob => "updated blob", clob => 'updated clob' })->all;
     is @objs, 1, 'found updated row';
     ok (try { $objs[0]->blob }||'' eq "updated blob", 'blob updated/retrieved correctly');
     ok (try { $objs[0]->clob }||'' eq "updated clob", 'clob updated/retrieved correctly');
+    ok (try { $objs[0]->clob2 }||'' eq "updated clob2", "clob2 updated correctly");
+    ok (try { $objs[0]->blob2 }||'' eq "updated blob2", "blob2 updated correctly");
 
     lives_ok {
       $rs->search({ id => $id  })
@@ -154,8 +152,6 @@ SKIP: {
     @objs = $rs->search({ blob => "re-updated blob", clob => 're-updated clob' })->all;
     is @objs, 0, 'row deleted successfully';
   }
-
-  $schema->storage->debug ($orig_debug);
 }
 
   do_clean ($dbh);