Bugzilla – Attachment 83733 Details for
Bug 22082
Ambiguous column in patron stats
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22082: ambiguous column in patron stats
Bug-22082-ambiguous-column-in-patron-stats.patch (text/plain), 2.10 KB, created by
Devinim
on 2019-01-08 20:12:52 UTC
(
hide
)
Description:
Bug 22082: ambiguous column in patron stats
Filename:
MIME Type:
Creator:
Devinim
Created:
2019-01-08 20:12:52 UTC
Size:
2.10 KB
patch
obsolete
>From 742a9f72fec3d639342455eaaec60cc88d548564 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 8 Jan 2019 14:32:19 +0100 >Subject: [PATCH] Bug 22082: ambiguous column in patron stats > >In Reports > Patrons statistics, the combination of activity and extended attributes generates an invalid SQL query with error : >ERROR 1052 (23000): Column 'borrowernumber' in IN/ALL/ANY subquery is ambiguous > >This is because FROM contains tables borrowers and borrower_attributes both containing borrowernumber column. > >Test plan : >1) Be sure to have a patron extended attribute >2) Be sure you have some recent circulation activity >3) Go to Reports > Patrons statistics >4) Select 'active' in 'Patron activity' and 1 years of activity >5) Check 'Row' in 'Patron category' >6) Check 'Columns' in a extended attribute >7) Submit >8) Without patch you have no results, with patch you have exepected results >--- > reports/borrowers_stats.pl | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl >index a58ccc74d0..08dce5af5a 100755 >--- a/reports/borrowers_stats.pl >+++ b/reports/borrowers_stats.pl >@@ -396,8 +396,8 @@ sub calculate { > $strcalc .= " AND attribute_$type.attribute LIKE '" . $filter . "' "; > } > } >- $strcalc .= " AND borrowernumber in (select distinct(borrowernumber) from old_issues where issuedate > '" . $newperioddate . "')" if ($activity eq 'active'); >- $strcalc .= " AND borrowernumber not in (select distinct(borrowernumber) from old_issues where issuedate > '" . $newperioddate . "' AND borrowernumber IS NOT NULL)" if ($activity eq 'nonactive'); >+ $strcalc .= " AND borrowers.borrowernumber in (select distinct(borrowernumber) from old_issues where issuedate > '" . $newperioddate . "')" if ($activity eq 'active'); >+ $strcalc .= " AND borrowers.borrowernumber not in (select distinct(borrowernumber) from old_issues where issuedate > '" . $newperioddate . "' AND borrowernumber IS NOT NULL)" if ($activity eq 'nonactive'); > $strcalc .= " AND $status='1' " if ($status); > > $strcalc .= " GROUP BY "; >-- >2.11.0
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 22082
:
83714
|
83733
|
83856