File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # $Id: 01-col-inheritance.t 989 2005-09-23 19:58:01Z btrott $
2+
3+ use strict;
4+ use warnings;
5+
6+ use lib ' t/lib' ;
7+
8+ $Data::ObjectDriver::DEBUG = 0;
9+ use Test::More;
10+ use DodTestUtil;
11+ BEGIN { eval { require Crypt::URandom; 1 } or plan skip_all => ' requires Crypt::URandom' }
12+
13+ BEGIN { DodTestUtil-> check_driver }
14+
15+ plan tests => 3;
16+
17+ setup_dbs({
18+ global => [ qw( wines ) ],
19+ });
20+
21+ use Wine;
22+ use Storable;
23+
24+ my $wine = Wine-> new;
25+ $wine -> name(" Saumur Champigny, Le Grand Clos 2001" );
26+ $wine -> rating(4);
27+
28+ # # generate some binary data (SQL_BLOB / MEDIUMBLOB)
29+ my $binary = Crypt::URandom::urandom(300);
30+ $wine -> content($binary );
31+ ok($wine -> save, ' Object saved successfully' );
32+
33+ my $iter ;
34+
35+ $iter = Data::ObjectDriver::Iterator-> new(sub {});
36+ my $wine_id = $wine -> id;
37+ undef $wine ;
38+ $wine = Wine-> lookup($wine_id );
39+
40+ ok $wine ;
41+ ok $wine -> content eq $binary ;
42+
43+ # TODO: bulk_insert doesn't support blob yet. We need to change some of its API so that we can call column_def in each dbd's bulk_insert
44+
45+ disconnect_all($wine );
46+ teardown_dbs(qw( global ) );
You can’t perform that action at this time.
0 commit comments