Skip to content

Commit

Permalink
Bug 1934616 - Add comment to SQL that is generated by buglist.cgi to …
Browse files Browse the repository at this point in the history
…add userid, query string, and user agent
  • Loading branch information
dklawren committed Dec 13, 2024
1 parent b9a8837 commit 9835559
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Bugzilla/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,19 @@ sub data {
'_no_security_check' => 1
);

# Add some user information to the SQL so we can pinpoint where some
# slow running queries originate and help to refine the searches.
my $sql_user_info
= ' /* userid: '
. Bugzilla->user->id
. ' useragent: '
. Bugzilla->cgi->user_agent
. ' query: '
. Bugzilla->cgi->canonicalize_query() . ' */ ';

$start_time = [gettimeofday()];
$sql = $search->_sql;
my $unsorted_data = $dbh->selectall_arrayref($sql);
my $unsorted_data = $dbh->selectall_arrayref($sql . $sql_user_info); # Add extra info for logging purposes
push(@extra_data, {sql => $sql, time => tv_interval($start_time)});

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

0 comments on commit 9835559

Please sign in to comment.