Bugzilla – Attachment 138466 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
Jonathan Druart
on 2022-08-01 12:49:22 UTC
(
hide
)
Description:
Bug 29579: Show saved SQL report ID in database query
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-08-01 12:49:22 UTC
Size:
1.33 KB
patch
obsolete
>From a89bbfaa6edc73cd3d11cf0c17372863e134e614 Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Thu, 21 Jul 2022 13:12:06 -0400 >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. > >Test Plan: >1) Apply this patch >2) Restart all the things! >3) Create a long running query like: > SELECT * FROM borrowers a, borrowers b, borrowers c, borrowers d >4) Connect to the database using koha-mysql >5) Execute "show processlist;" >6) Note the Info column looks something like: > SELECT * FROM borrowers a, borrowers b, borrowers c, borrowers d /* saved_sql.id: 1 */ > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/Report.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/Koha/Report.pm b/Koha/Report.pm >index 176fb6e2535..35d46c4c212 100644 >--- a/Koha/Report.pm >+++ b/Koha/Report.pm >@@ -182,6 +182,8 @@ sub prep_report { > } > $sql =~ s/<<$split[$i*2+1]>>/$quoted/; > } >+ >+ $sql = "$sql /* saved_sql.id: ${\( $self->id )} */"; > return $sql, $headers; > } > >-- >2.25.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