Who uses data/sqllog?
Bradley Baetz
bbaetz at student.usyd.edu.au
Sat Aug 31 09:28:48 UTC 2002
Emulating data/sqllog exactly is going to be a big pain. So, I'd like to
know who actually uses it, and if they do, what for?
I believe that the original purpose was to log slow queries, but mysql now
handles that with its own option.
I presume that bmo doesn't use it, because the exclusive locking would
probably slow stuff down. It doesn't work on windows < winnt,
either, according to perlport.pod.
DBI does have a Trace variable which can be used, but its a lot more
verbose, even on its lowest setting;
use Bugzilla::DBI;
my $dbh = Bugzilla::DBI->connect();
print $dbh->selectrow_array("SELECT bug_id FROM bugs WHERE bug_id = 4");
print $dbh->selectrow_array("SELECT bug_id FROM bugs WHERE bug_id = 3");
gives:
DBI 1.30-nothread dispatch trace level set to 1
1 <- prepare('SELECT bug_id FROM bugs WHERE bug_id = 4')=
Bugzilla::DBI::st=HASH(0x832fb08) at DBI.pm line 111
<- FETCH('Statement')= 'SELECT bug_id FROM bugs WHERE bug_id = 4'
('Statement' from cache) at - line 3
<- selectrow_array('SELECT bug_id FROM bugs WHERE bug_id = 4')= ( '4'
) [1 items] at - line 3
<- DESTROY= undef at - line 4
1 <- prepare('SELECT bug_id FROM bugs WHERE bug_id = 3')=
Bugzilla::DBI::st=HASH(0x8348800) at DBI.pm line 111
<- FETCH('Statement')= 'SELECT bug_id FROM bugs WHERE bug_id = 3'
('Statement' from cache) at - line 4
<- selectrow_array('SELECT bug_id FROM bugs WHERE bug_id = 3')= ( '3'
) [1 items] at - line 4
<- DESTROY= undef
<- disconnect_all= '' at DBI.pm line 565
<- DESTROY= undef during global destruction
<- DESTROY= undef during global destruction
when tracing is turned on after connecting. It also prints the values that
its fetching.
On higher trace levels, DBI prints more information than you'd ever want
to know.
So, the choices are:
1) If people only use this for occasional debugging, then I'll just set
DBI up to trace to data/sqllog if it exists.
2) I can keep the current implementation basically as-is
3) Something else.
Thoughts?
Bradley
More information about the developers
mailing list