Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1934616 - Add comment to SQL that is generated by buglist.cgi to add userid, query string, and user agent #2373

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading