Bugzilla – Attachment 130496 Details for
Bug 29579
Show saved SQL report ID in database query
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29579: Show saved SQL report ID in database query
Bug-29579-Show-saved-SQL-report-ID-in-database-que.patch (text/plain), 1.33 KB, created by
Owen Leonard
on 2022-02-11 13:46:07 UTC
(
hide
)
Description:
Bug 29579: Show saved SQL report ID in database query
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-02-11 13:46:07 UTC
Size:
1.33 KB
patch
obsolete
>From ecdce7da060c8b58fa974990cffd0a3c30eb2bd9 Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> >Date: Fri, 26 Nov 2021 11:54:52 +0200 >Subject: [PATCH] Bug 29579: Show saved SQL report ID in database query > >When trying to figure out which saved SQL report caused too much load, >it's useful to have the report id show in the mysql process list. > >This patch adds the saved SQL ID number as a comment line in front >of the SQL before passing it to the database. > >To test: >1) Run a saved report that takes long enough time, so you can: >2) Connect to the database with your preferred client, and use > "show processlist;" to list all the running mysql processes. >3) The running saved SQL report should show up with > "-- saved_sql.id=123" in the process info field. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Reports/Guided.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm >index 310b3e9145..282c0d85b6 100644 >--- a/C4/Reports/Guided.pm >+++ b/C4/Reports/Guided.pm >@@ -593,6 +593,7 @@ sub execute_query { > > $dbh->do( 'UPDATE saved_sql SET last_run = NOW() WHERE id = ?', undef, $report_id ) if $report_id; > >+ $sql = "-- saved_sql.id=$report_id\n" . $sql; > my $sth = $dbh->prepare($sql); > eval { > $sth->execute(@$sql_params, $offset, $limit); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29579
:
128037
|
130496
|
130538
|
137989
|
137990
|
138068
|
138460
|
138466
|
138467