[Koha-bugs] [Bug 10454] Duplicate card numbers may be generated

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Sep 12 21:00:19 CEST 2013


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

--- Comment #21 from M. Tompsett <mtompset at hotmail.com> ---
SUBSTR can be fixed. YAY! SUBSTRING is ANSI-1992.
The UNSIGNED, from CAST( ... AS UNSIGNED), can be worked around using BIGINT
and adding a >0 constraint on the value. Not sure I like that, but it will
suffice.

The only outstanding issue is LAST_INSERT_ID(). It can't really be ANSI SQL'd.
:( However, as I mentioned a call to C4::Context->db_scheme2dbi in future code
can provide optimized methods for other SQL back-ends.

Given this last problem, I'm not sure there is a generic ANSI SQL way to do
LAST_INSERT_ID. See Galen's comments in Comment 14. I think the use of a
working C4::Context->db_scheme2dbi would be an acceptable work around, as we
aim for a balance of speed and db-agnosticism. Granted, my position does not
reflect the will of the masses. :)

What other back-ends are people even trying right now other than MariaDB and
Postgre? It would seem to me that the software aims to be ANSI SQL, but there
are portions which are just plain better being SQL specific. Also note that
http://wiki.koha-community.org/wiki/Coding_Guidelines does not mention avoiding
mysqlisms, except for backticks.

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


More information about the Koha-bugs mailing list