X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F73oracle.t;h=50c519f084dcb8f093b1e5ffaa391a53d6ad439a;hb=282a9a4fb1a740c3500c158d7d6ebb29a86f0f78;hp=04f164123d5f82dedd58771d36f53d49a30e28b6;hpb=6c0230de282983fa588795e3f81ce16fcd9ef316;p=dbsrgits%2FDBIx-Class.git diff --git a/t/73oracle.t b/t/73oracle.t index 04f1641..50c519f 100644 --- a/t/73oracle.t +++ b/t/73oracle.t @@ -229,28 +229,34 @@ my $st = $schema->resultset('SequenceTest')->create({ name => 'foo', pkid1 => 55 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; - my %binstr = ( 'small' => join('', map { chr($_) } ( 1 .. 127 )) ); - $binstr{'large'} = $binstr{'small'} x 1024; + my $maxloblen = length $binstr{'large'}; + note "Localizing LongReadLen to $maxloblen to avoid truncation of test data"; + local $dbh->{'LongReadLen'} = $maxloblen; - my $maxloblen = length $binstr{'large'}; - note "Localizing LongReadLen to $maxloblen to avoid truncation of test data"; - local $dbh->{'LongReadLen'} = $maxloblen; + my $rs = $schema->resultset('BindType'); + my $id = 0; - 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'; - foreach my $type (qw( blob clob )) { - foreach my $size (qw( small large )) { - $id++; + skip 'buggy BLOB support in DBD::Oracle 1.23', 7; + } + + foreach my $type (qw( blob clob )) { + foreach my $size (qw( small large )) { + $id++; + + lives_ok { $rs->create( { 'id' => $id, $type => $binstr{$size} } ) } + "inserted $size $type without dying"; - lives_ok { $rs->create( { 'id' => $id, $type => $binstr{$size} } ) } - "inserted $size $type without dying"; - ok($rs->find($id)->$type eq $binstr{$size}, "verified inserted $size $type" ); - } - } + ok($rs->find($id)->$type eq $binstr{$size}, "verified inserted $size $type" ); + } + } } done_testing;