Skip to content
Snippets Groups Projects
Commit f4ef5196 authored by Graham McVicker's avatar Graham McVicker
Browse files

added a function that can be uncommented to obtain a lot of useful debug info...

added a function that can be uncommented to obtain a lot of useful debug info about every query executed
parent 48d0b727
No related branches found
No related tags found
No related merge requests found
......@@ -27,12 +27,12 @@ package Bio::EnsEMBL::DBSQL::StatementHandle;
use vars qw(@ISA);
use strict;
use Bio::EnsEMBL::Utils::Exception qw(warning);
use Bio::EnsEMBL::Utils::Exception qw(warning stack_trace_dump);
use DBD::mysql;
use DBI;
use Time::HiRes qw(time);
#use Time::HiRes qw(time);
@ISA = qw(DBI::st);
......@@ -73,6 +73,37 @@ sub sql {
}
#
# uncomment this for printing out handy debug information (every query)
#
# sub execute {
# my $self = shift;
# my $sql = $self->sql();
# my @chrs = split(//, $sql);
# my $j = 0;
# for(my $i =0; $i < @chrs; $i++) {
# $chrs[$i] = $_[$j++] if($chrs[$i] eq '?' && defined($_[$j]));
# }
# my $str = join('', @chrs);
# my $time = time;
# print STDERR "\nSQL:\n$str\n\n";
# # print STDERR stack_trace_dump(), "\n";
# my $res = $self->SUPER::execute(@_);
# $time = time - $time;
# print STDERR "DONE ($time)\n";
# return $res;
# }
sub DESTROY {
my ($obj) = @_;
......
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