Bug 22082 - Ambiguous column in patron stats
Summary: Ambiguous column in patron stats
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-08 13:21 UTC by Fridolin Somers
Modified: 2020-01-06 20:17 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22082: ambiguous column in patron stats (2.10 KB, patch)
2019-01-08 14:00 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 22082: ambiguous column in patron stats (2.10 KB, patch)
2019-01-08 20:12 UTC, Devinim
Details | Diff | Splinter Review
Bug 22082: ambiguous column in patron stats (2.16 KB, patch)
2019-01-13 21:34 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2019-01-08 13:21:49 UTC
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
Comment 1 Fridolin Somers 2019-01-08 14:00:26 UTC
Created attachment 83714 [details] [review]
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
Comment 2 Devinim 2019-01-08 20:12:52 UTC
Created attachment 83733 [details] [review]
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
Comment 3 Katrin Fischer 2019-01-13 21:34:36 UTC
Created attachment 83856 [details] [review]
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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2019-01-13 21:35:17 UTC
Never hurts to be specific :) Good catch, Frido!
Comment 5 Nick Clemens 2019-01-18 20:59:36 UTC
Awesome work all!

Pushed to master for 19.05
Comment 6 Martin Renvoize 2019-01-23 12:46:39 UTC
Pushed to 18.11.x for 18.11.03
Comment 7 Lucas Gass 2019-01-23 23:07:40 UTC
backported to 18.05 for 18.05.09
Comment 8 Fridolin Somers 2019-01-30 08:48:18 UTC
Pushed to 17.11.x for 17.11.15