Merge 'rt_bug_41083' into 'trunk'
[dbsrgits/DBIx-Class.git] / t / bindtype_columns.t
index 05b514c..cf0649d 100644 (file)
@@ -10,7 +10,7 @@ my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/}
 plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
   unless ($dsn && $dbuser);
   
-plan tests => 3;
+plan tests => 6;
 
 my $schema = DBICTest::Schema->connection($dsn, $dbuser, $dbpass, { AutoCommit => 1 });
 
@@ -18,7 +18,9 @@ my $dbh = $schema->storage->dbh;
 
 {
     local $SIG{__WARN__} = sub {};
-    $dbh->do('DROP TABLE IF EXISTS artist');
+    $dbh->do('DROP TABLE IF EXISTS bindtype_test');
+
+    # the blob/clob are for reference only, will be useful when we switch to SQLT and can test Oracle along the way
 
     # the blob/clob are for reference only, will be useful when we switch to SQLT and can test Oracle along the way
     $dbh->do(qq[
@@ -32,8 +34,11 @@ my $dbh = $schema->storage->dbh;
     ],{ RaiseError => 1, PrintError => 1 });
 }
 
-# test primary key handling
-my $big_long_string    = 'abcd' x 250000;
+# test retrieval of the bytea column
+{
+  my $row = $schema->resultset('BindType')->find({ id => $new->id });
+  is($row->get_column('bytea'), $big_long_string, "Created the blob correctly.");
+}
 
 my $new = $schema->resultset('BindType')->create({ bytea => $big_long_string });
 
@@ -46,5 +51,4 @@ is($rs->get_column('bytea'), $big_long_string, "Created the blob correctly.");
 
 $dbh->do("DROP TABLE bindtype_test");
 
-
-
+$dbh->do("DROP TABLE bindtype_test");