plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
unless ($dsn && $dbuser);
-plan tests => 6;
-
my $schema = DBICTest::Schema->connection($dsn, $dbuser, $dbpass, { AutoCommit => 1 });
my $dbh = $schema->storage->dbh;
# 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[
- CREATE TABLE bindtype_test
+ CREATE TABLE bindtype_test
(
id serial NOT NULL PRIMARY KEY,
bytea bytea NULL,
blob bytea NULL,
- clob text NULL
+ clob text NULL,
+ a_memo text NULL
);
],{ RaiseError => 1, PrintError => 1 });
}
+$schema->storage->debug(0); # these tests spew up way too much stuff, disable trace
+
my $big_long_string = "\x00\x01\x02 abcd" x 125000;
my $new;
$schema->txn_rollback;
});
}
+
+ # create with blob from $rs
+ $new = $rs->create({});
+ is($new->bytea, $big_long_string, 'Object has bytea value from $rs');
+ $new->discard_changes;
+ is($new->bytea, $big_long_string, 'bytea value made it to db');
}
-$dbh->do("DROP TABLE bindtype_test");
+done_testing;
+
+eval { $dbh->do("DROP TABLE bindtype_test") };
+