Skip to content

Commit 70544f7

Browse files
authored
Bug 1934616 - Add comment to SQL that is generated by buglist.cgi to add userid, query string, and user agent
1 parent 65dfb01 commit 70544f7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Bugzilla/Search.pm

+11-1
Original file line numberDiff line numberDiff line change
@@ -870,9 +870,19 @@ sub data {
870870
'_no_security_check' => 1
871871
);
872872

873+
# Add some user information to the SQL so we can pinpoint where some
874+
# slow running queries originate and help to refine the searches.
875+
my $sql_user_info
876+
= ' /* userid: '
877+
. Bugzilla->user->id
878+
. ' useragent: '
879+
. Bugzilla->cgi->user_agent
880+
. ' query: '
881+
. Bugzilla->cgi->canonicalize_query() . ' */ ';
882+
873883
$start_time = [gettimeofday()];
874884
$sql = $search->_sql;
875-
my $unsorted_data = $dbh->selectall_arrayref($sql);
885+
my $unsorted_data = $dbh->selectall_arrayref($sql . $sql_user_info); # Add extra info for logging purposes
876886
push(@extra_data, {sql => $sql, time => tv_interval($start_time)});
877887

878888
# Let's sort the data. We didn't do it in the query itself because

0 commit comments

Comments
 (0)