[Koha-bugs] [Bug 7785] MySQL-specific syntax in C4::Members columns()

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jul 11 00:54:43 CEST 2013


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

Tomás Cohen Arazi <tomascohen at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #19527|0                           |1
        is obsolete|                            |

--- Comment #14 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 19534
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19534&action=edit
Bug 7785 - MySQL-specific syntax in C4::Members columns()

The initial thought was to remove this function. However,
tools/import_borrowers.pl uses it. So rather than remove
it to solve the problem, it was reworked to a more generic
solution which runs faster.

By accessing $sth->{NAME} directly, the driver becomes
responsible for filling it correctly. This happens when a SELECT
is done on the borrowers table. It does not even have to have
data in the result set!

The columns method could be more generic and used elsewhere too.
Comparison between the old method and the STH method showed a
difference of 35 seconds for 40k iterations versus 19 seconds
for the same amount of iterations on regardless of the size of
the borrowers table.

Signed-off-by: Tomas Cohen Arazi <tomascohen at gmail.com>
The patch itself removes the mysql-ism and works as expected. I agree with
Galen that we shouldn't be doing this ad-hoc and the introduction
of DBIx would be the best solution (modulo performance issues).

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list