Author: turnstep
Date: Mon Apr 28 10:13:23 2008
New Revision: 11147

Modified:
   DBD-Pg/trunk/t/12placeholders.t

Log:
Catch error when backslash_quote is on.


Modified: DBD-Pg/trunk/t/12placeholders.t
==============================================================================
--- DBD-Pg/trunk/t/12placeholders.t     (original)
+++ DBD-Pg/trunk/t/12placeholders.t     Mon Apr 28 10:13:23 2008
@@ -130,12 +130,16 @@
        $dbh->do(q{SET NAMES 'UTF8'});
 }
 
+my $SQL = 'SHOW backslash_quote';
+my $backslash = $dbh->selectall_arrayref($SQL)->[0][0];
+
 $t=q{Prepare with backslashes inside quotes works};
 $sth = $dbh->prepare(q{SELECT '\\'?'});
 eval {
        $sth->execute();
 };
-is( $@, q{}, $t);
+my $expected = $backslash eq 'off' ? qr{unsafe} : qr{};
+like( $@, $expected, $t);
 $sth->finish();
 $dbh->commit();
 

Reply via email to