develooper Front page | perl.dbi.users | Postings from April 2018

debugging and stepping into ->do

Thread Next
Jeff Macdonald
April 25, 2018 15:13
debugging and stepping into ->do
Message ID:

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 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

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About