my $formatted;
if ($self->squash_repeats && $self->_last_sql eq $string) {
my ( $l, $r ) = @{ $sqlat->placeholder_surround };
- $formatted = '... : ' . join(', ', map "$l$_$r", @$bindargs) . "\n";
+ $formatted = '... : ' . join(', ', map "$l$_$r", @$bindargs)
} else {
$self->_last_sql($string);
- $formatted = $sqlat->format($string, $bindargs) . "\n";
- $formatted = "$formatted: " . join ', ', @{$bindargs}
+ $formatted = $sqlat->format($string, $bindargs);
+ $formatted = "$formatted : " . join ', ', @{$bindargs}
unless $use_placeholders;
}
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More;
+use DBIx::Class::Storage::Debug::PrettyPrint;
+
+my $cap;
+open my $fh, '>', \$cap;
+
+my $pp = DBIx::Class::Storage::Debug::PrettyPrint->new({
+ profile => 'none',
+ fill_in_placeholders => 1,
+ placeholder_surround => [qw(' ')],
+ show_progress => 0,
+});
+
+$pp->debugfh($fh);
+
+$pp->query_start('INSERT INTO self_ref_alias (alias, self_ref) VALUES ( ?, ? )', qw('__BULK_INSERT__' '1'));
+is(
+ $cap,
+ qq{INSERT INTO self_ref_alias (alias, self_ref) VALUES (?, ?) : '__BULK_INSERT__', '1'\n},
+ 'SQL Logged'
+);
+
+done_testing;