[Bast-commits] r7611 - in DBIx-Class/0.08/branches/sybase:
lib/DBIx/Class/Storage/DBI t
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Wed Sep 9 10:08:36 GMT 2009
Author: caelum
Date: 2009-09-09 10:08:36 +0000 (Wed, 09 Sep 2009)
New Revision: 7611
Modified:
DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm
DBIx-Class/0.08/branches/sybase/t/746sybase.t
Log:
test multi-row blob update
Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm 2009-09-09 09:41:56 UTC (rev 7610)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase.pm 2009-09-09 10:08:36 UTC (rev 7611)
@@ -10,6 +10,7 @@
use mro 'c3';
use Carp::Clan qw/^DBIx::Class/;
use List::Util ();
+use Sub::Name ();
__PACKAGE__->mk_group_accessors('simple' =>
qw/_identity _blob_log_on_update _insert_dbh _identity_method/
@@ -317,7 +318,9 @@
sub _insert {
my ($self, $source, $to_insert, $blob_cols, $identity_col) = @_;
- my $updated_cols = $self->next::method ($source, $to_insert);
+ my $updated_cols =
+ (Sub::Name::subname insert =>
+ sub { $self->next::method ($source, $to_insert) })->();
my $final_row = {
$identity_col => $self->last_insert_id($source, $identity_col),
Modified: DBIx-Class/0.08/branches/sybase/t/746sybase.t
===================================================================
--- DBIx-Class/0.08/branches/sybase/t/746sybase.t 2009-09-09 09:41:56 UTC (rev 7610)
+++ DBIx-Class/0.08/branches/sybase/t/746sybase.t 2009-09-09 10:08:36 UTC (rev 7611)
@@ -11,7 +11,7 @@
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/};
-my $TESTS = 40 + 2;
+my $TESTS = 41 + 2;
if (not ($dsn && $user)) {
plan skip_all =>
@@ -199,7 +199,7 @@
# mostly stolen from the blob stuff Nniuq wrote for t/73oracle.t
SKIP: {
- skip 'TEXT/IMAGE support does not work with FreeTDS', 12
+ skip 'TEXT/IMAGE support does not work with FreeTDS', 13
if $schema->storage->using_freetds;
my $dbh = $schema->storage->_dbh;
@@ -293,6 +293,14 @@
};
diag $@ if $@;
ok($got eq $new_str, "verified updated blob");
+
+ ## try multi-row blob update
+ # first insert some blobs
+ $rs->find(1)->delete;
+ $rs->create({ blob => $binstr{large} }) for (1..3);
+ $new_str = $binstr{large} . 'foo';
+ $rs->update({ blob => $new_str });
+ is((grep $_->blob eq $new_str, $rs->all), 3, 'multi-row blob update');
}
# test MONEY column support
More information about the Bast-commits
mailing list