[Koha-bugs] [Bug 9921] Make it possible to force 001 = biblionumber

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jun 20 16:18:49 CEST 2013


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

--- Comment #43 from M. de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to comment #40)
> Marcel - not sure, but is the LAST_INSERT_ID a MySQLism? I seem to remember
> a discussion in IRC about it, but of course... I can't remember enough to
> explain why I have it memorized as not a good idea. :(

If we go through DBI, we have actually two choices: the more generic
last_insert_id and the mysql-bound mysql_insert_id.
If you do a grep on both, you will see that they are used a lot in Koha.

Actually, AddBiblio relies on:
my $biblionumber = $dbh->{'mysql_insertid'};

But note that last_insert_id may be more portable, it is considered less
reliable than e.g. using MySQL with mysql_insertid.
Since AddBiblio relies on it, I would have no objection to using one of the two
constructs.

One other point: I see confirmation that it is connection-safe, but I saw some
claims that it could not be thread-safe (threads using the same connection).
Of course, this also holds for current code.

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


More information about the Koha-bugs mailing list