X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSQLTracerObj.pm;h=5763639f954bc291102ab577cda7a2c422f72a24;hb=8b60b9211a085572446bbfd19e879d00ae03658a;hp=23baeb34dbbfbfe1e1594cb3c8594ca22199362f;hpb=7d6c28b70b4c37d6296ea4a17ac919799b3a8bc2;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest/SQLTracerObj.pm b/t/lib/DBICTest/SQLTracerObj.pm index 23baeb3..5763639 100644 --- a/t/lib/DBICTest/SQLTracerObj.pm +++ b/t/lib/DBICTest/SQLTracerObj.pm @@ -6,7 +6,16 @@ use warnings; use base 'DBIx::Class::Storage::Statistics'; -sub query_start { push @{$_[0]{sqlbinds}}, [ ($_[1] =~ /^\s*(\S+)/)[0], [ $_[1], @{ $_[2]||[] } ] ] } +sub query_start { + my ($self, $sql, $bind) = @_; + + my $op = ($sql =~ /^\s*(\S+)/)[0]; + + $sql =~ s/^ \s* \Q$op\E \s+ \[ .+? \]/$op/x + if $ENV{DBICTEST_VIA_REPLICATED}; + + push @{$self->{sqlbinds}}, [ $op, [ $sql, @{ $bind || [] } ] ]; +} # who the hell came up with this API >:( for my $txn (qw(begin rollback commit)) {