Bugzilla – Attachment 132589 Details for
Bug 26669
Last Run column not updated when report is run publicly (via CoverFlow or elsewhere)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26669: Adjust POD
Bug-26669-Adjust-POD.patch (text/plain), 4.67 KB, created by
Nick Clemens (kidclamp)
on 2022-03-30 12:28:53 UTC
(
hide
)
Description:
Bug 26669: Adjust POD
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-03-30 12:28:53 UTC
Size:
4.67 KB
patch
obsolete
>From 28de48f6280d5fda648653d407e7edbb5ad0b7fb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 30 Mar 2022 12:25:42 +0000 >Subject: [PATCH] Bug 26669: Adjust POD > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Reports/Guided.pm | 102 ++++++++++++++++++++++++------------------- > 1 file changed, 58 insertions(+), 44 deletions(-) > >diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm >index 5ccf0c105c..b948ecfcd0 100644 >--- a/C4/Reports/Guided.pm >+++ b/C4/Reports/Guided.pm >@@ -464,35 +464,15 @@ sub nb_rows { > return $results ? $results->[0] : 0; > } > >-=head2 execute_query >- >- ($sth, $error) = execute_query($sql, $offset, $limit[, \@sql_params]) >- >- >-This function returns a DBI statement handler from which the caller can >-fetch the results of the SQL passed via C<$sql>. >- >-If passed any query other than a SELECT, or if there is a DB error, >-C<$errors> is returned, and is a hashref containing the error after this >-manner: >- >-C<$error->{'sqlerr'}> contains the offending SQL keyword. >-C<$error->{'queryerr'}> contains the native db engine error returned >-for the query. >- >-C<$offset>, and C<$limit> are required parameters. >+=head2 select_2_select_count > >-C<\@sql_params> is an optional list of parameter values to paste in. >-The caller is responsible for making sure that C<$sql> has placeholders >-and that the number placeholders matches the number of parameters. >+ returns $sql, $offset, $limit >+ $sql returned will be transformed to: >+ ~ remove any LIMIT clause >+ ~ replace SELECT clause w/ SELECT count(*) > > =cut > >-# returns $sql, $offset, $limit >-# $sql returned will be transformed to: >-# ~ remove any LIMIT clause >-# ~ repace SELECT clause w/ SELECT count(*) >- > sub select_2_select_count { > # Modify the query passed in to create a count query... (I think this covers all cases -crn) > my ($sql) = strip_limit(shift) or return; >@@ -500,25 +480,29 @@ sub select_2_select_count { > return $sql; > } > >-# This removes the LIMIT from the query so that a custom one can be specified. >-# Usage: >-# ($new_sql, $offset, $limit) = strip_limit($sql); >-# >-# Where: >-# $sql is the query to modify >-# $new_sql is the resulting query >-# $offset is the offset value, if the LIMIT was the two-argument form, >-# 0 if it wasn't otherwise given. >-# $limit is the limit value >-# >-# Notes: >-# * This makes an effort to not break subqueries that have their own >-# LIMIT specified. It does that by only removing a LIMIT if it comes after >-# a WHERE clause (which isn't perfect, but at least should make more cases >-# work - subqueries with a limit in the WHERE will still break.) >-# * If your query doesn't have a WHERE clause then all LIMITs will be >-# removed. This may break some subqueries, but is hopefully rare enough >-# to not be a big issue. >+=head2 strip_limit >+This removes the LIMIT from the query so that a custom one can be specified. >+Usage: >+ ($new_sql, $offset, $limit) = strip_limit($sql); >+ >+Where: >+ $sql is the query to modify >+ $new_sql is the resulting query >+ $offset is the offset value, if the LIMIT was the two-argument form, >+ 0 if it wasn't otherwise given. >+ $limit is the limit value >+ >+Notes: >+ * This makes an effort to not break subqueries that have their own >+ LIMIT specified. It does that by only removing a LIMIT if it comes after >+ a WHERE clause (which isn't perfect, but at least should make more cases >+ work - subqueries with a limit in the WHERE will still break.) >+ * If your query doesn't have a WHERE clause then all LIMITs will be >+ removed. This may break some subqueries, but is hopefully rare enough >+ to not be a big issue. >+ >+=cut >+ > sub strip_limit { > my ($sql) = @_; > >@@ -539,6 +523,36 @@ sub strip_limit { > } > } > >+=head2 execute_query >+ >+ ($sth, $error) = execute_query({ >+ sql => $sql, >+ offset => $offset, >+ limit => $limit >+ sql_params => \@sql_params], >+ report_id => $report_id >+ }) >+ >+ >+This function returns a DBI statement handler from which the caller can >+fetch the results of the SQL passed via C<$sql>. >+ >+If passed any query other than a SELECT, or if there is a DB error, >+C<$errors> is returned, and is a hashref containing the error after this >+manner: >+ >+C<$error->{'sqlerr'}> contains the offending SQL keyword. >+C<$error->{'queryerr'}> contains the native db engine error returned >+for the query. >+ >+C<$offset>, and C<$limit> are required parameters. >+ >+C<\@sql_params> is an optional list of parameter values to paste in. >+The caller is responsible for making sure that C<$sql> has placeholders >+and that the number placeholders matches the number of parameters. >+ >+=cut >+ > sub execute_query { > > my $params = shift; >-- >2.30.2
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 26669
:
115165
|
115166
|
115414
|
131539
|
132547
|
132548
|
132549
|
132587
|
132588
| 132589 |
132590