Skip to content
Snippets Groups Projects
Commit 9180995b authored by Jessica Severin's avatar Jessica Severin
Browse files

added new variable/method query_count

increments this variable on every call to prepare and do methods
parent efeb6af8
No related branches found
No related tags found
No related merge requests found
......@@ -233,6 +233,13 @@ sub disconnect_count {
return $self->{'disconnect_count'};
}
sub query_count {
my $self = shift;
return $self->{'_query_count'} = shift if(@_);
$self->{'_query_count'}=0 unless(defined($self->{'_query_count'}));
return $self->{'_query_count'};
}
=head2 equals
......@@ -550,6 +557,7 @@ sub prepare {
$sth->dbc($self);
$sth->sql($string);
$self->query_count($self->query_count()+1);
return $sth;
}
......@@ -584,7 +592,9 @@ sub do {
if($self->disconnect_when_inactive()) {
$self->disconnect_if_idle();
}
$self->query_count($self->query_count()+1);
return $result;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment