5 if (defined $ENV{DBI_DSN}) {
8 plan skip_all => 'cannot test without DB info';
11 my $dbh = DBI->connect($ENV{DBI_DSN}, $ENV{DBI_USER}, $ENV{DBI_PASS},
12 {RaiseError => 1, AutoCommit => 0}
15 'connect with transaction'
18 my $quo = $dbh->quote("\\'?:");
19 my $sth = $dbh->prepare(qq{
20 INSERT INTO test (name) VALUES ($quo)
29 $sth = $dbh->prepare($sql);
32 my ($retr) = $sth->fetchrow_array();
33 ok((defined($retr) && $retr eq "\\'?:"),
38 local $dbh->{PrintError} = 0;
42 'execute with one bind param where none expected'
50 $sth = $dbh->prepare($sql);
52 $sth->execute("\\'?:");
54 ($retr) = $sth->fetchrow_array();
55 ok((defined($retr) && $retr eq "\\'?:"),
56 'execute with ? placeholder'
64 $sth = $dbh->prepare($sql);
66 $sth->execute("\\'?:");
68 ($retr) = $sth->fetchrow_array();
69 ok((defined($retr) && $retr eq "\\'?:"),
70 'execute with :1 placeholder'
78 $sth = $dbh->prepare($sql);
81 local $dbh->{PrintError} = 0;
85 'execute with quoted ?'
93 $sth = $dbh->prepare($sql);
96 local $dbh->{PrintError} = 0;
100 'execute with quoted :1'
109 $sth = $dbh->prepare($sql);
112 local $dbh->{PrintError} = 0;
113 local $sth->{PrintError} = 0;
114 $sth->execute('foo');
117 'execute with quoted ?'
123 ok($dbh->disconnect(),