debugging and stepping into ->do
[email protected] (Jeff Macdonald) Wed, 25 Apr 2018 15:13:41 +0000
| Newsgroups | perl.dbi.users |
|---|---|
| Message-ID | <CAB8aueZY4Fuy8z6wVxZOGqmNwK41xOGd3iZi=RyYF0nv1=aSzw@mail.gmail.com> |
Hi,
When using DBD::mysql, I can step into the prepare and execute methods of
DBD, but I can't step into do (execution is the next code line after the do
statement). 'do' is defined in DBI.pm this way:
sub do {
my($dbh, $statement, $attr, @params) = @_;
my $sth = $dbh->prepare($statement, $attr) or return undef;
$sth->execute(@params) or return undef;
my $rows = $sth->rows;
($rows == 0) ? "0E0" : $rows;
}
Based on this, if I were to put a breakpoint on execute, I should be able
to see 'do' statements via execute, but I don't. For example:
$dbh->do('insert into foo (a, b) values (1,2)')
should cause the execute method to be called, but that does not seem to be
the case. Is 'do' in DBI/DBD calling some magic method?
--
Jeff Macdonald
Ayer, MA