http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9121

            Bug ID: 9121
           Summary: C4::Serial SQL possible collision on
                    subscription.subscriptionid and
                    subscriptionhistory.subscriptionid
    Classification: Unclassified
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Serials
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

In C4::serials a few queries use queries of the form
SELECT subscription.*, subscriptionhistory.*
FROM subscription
LEFT JOIN subscriptionhisotry USING(subscriptionid)

If there are is a subscription without a matching subscriptionhistory then this
join results in
subscription.subscriptionid | subscriptionhistory.subscriptionid
----------------------------------------------------------------
1234                        |  NULL

Once this is fetched and squashed in to a hashref (for example, via
fetchall_arrayref) this will be
{ subscriptionid => undef }

This implicitly requires that every subscription has a matching
subscriptionhistory.

If we change the subscriptionhistory.* to select only the parts we need then we
can avoid this issue.

For SearchSubscription (which is only used by serials/serials-search.pl) none
of the columns from subscriptionhistory appear to be used.

We could also add a 'subscription.subscriptionid' to the end of the select, but
this seems less clean.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to