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'
24 my $sth = $dbh->prepare($sql);
29 $sth->bind_param(1, 1);
31 'exectute with one bind param'
34 $sth->bind_param(1, 2);
36 'exectute with rebinding one param'
46 $sth = $dbh->prepare($sql);
51 $sth->bind_param(1, 2);
52 $sth->bind_param(2, 'foo');
54 'exectute with two bind params'
58 local $dbh->{PrintError} = 0;
59 $sth = $dbh->prepare($sql);
60 $sth->bind_param(1, 2);
64 'execute with only first of two params bound'
68 local $dbh->{PrintError} = 0;
69 $sth = $dbh->prepare($sql);
70 $sth->bind_param(2, 'foo');
74 'execute with only second of two params bound'
78 local $dbh->{PrintError} = 0;
79 $sth = $dbh->prepare($sql);
83 'execute with neither of two params bound'
86 $sth = $dbh->prepare($sql);
87 ok($sth->execute(1, 'foo'),
88 'execute with both params bound in execute'
92 local $dbh->{PrintError} = 0;
93 $sth = $dbh->prepare(q{
103 'execute with only one of two params bound in execute'
111 ok($dbh->disconnect(),