From e9b3e61c24aa6469dc25cc34ff34b03cbc834d7d Mon Sep 17 00:00:00 2001 From: Tina Mueller Date: Wed, 29 Jul 2015 16:36:28 +0200 Subject: [PATCH 1/3] remove identity retrieval statement for blob inserts (Sybase) --- lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm index fcbd0a713..3b493c980 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm @@ -791,6 +791,9 @@ sub _insert_blobs { $self->throw_exception('Cannot update TEXT/IMAGE column(s) without primary key values') if ((grep { defined $row{$_} } @primary_cols) != @primary_cols); + # do not perform identity retrieval on blob inserts + local $self->{_perform_autoinc_retrieval} = undef; + for my $col (keys %$blob_cols) { my $blob = $blob_cols->{$col}; From cd742d01b3d45104ab06b7ff1331677b6799e865 Mon Sep 17 00:00:00 2001 From: Tina Mueller Date: Wed, 29 Jul 2015 17:33:42 +0200 Subject: [PATCH 2/3] add tinita to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 90f30335b..240de2247 100644 --- a/AUTHORS +++ b/AUTHORS @@ -199,6 +199,7 @@ teejay: Aaron Trevena theorbtwo: James Mastros Thomas Kratz timbunce: Tim Bunce +tinita: Tina Mueller Todd Lipcon Tom Hukins tommy: Tommy Butler From 2aed7179a8477180f326cbd9a9cc20f00c882a13 Mon Sep 17 00:00:00 2001 From: Tina Mueller Date: Tue, 4 Aug 2015 15:52:42 +0200 Subject: [PATCH 3/3] test for blob insert inside of transaction --- t/746sybase.t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/746sybase.t b/t/746sybase.t index d4588c52e..4f1c2cdd0 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -490,6 +490,14 @@ SQL $rs->update({ blob => undef }); is((grep !defined($_->blob), $rs->all), 2); } 'blob update to NULL'; + + lives_ok { + $schema->txn_do(sub { + my $created = $rs->create( { clob => "some text" } ); + }); + } 'insert blob field in transaction'; + $ping_count-- if $@; # dbh_do calls ->connected + } # test MONEY column support (and some other misc. stuff)