[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 17:38:54 CEST 2013


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

--- Comment #45 from Galen Charlton <gmcharlt at gmail.com> ---
(In reply to comment #43)
> 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.

Actually, it looks like DBD::mysql bases its implementation of its
last_insert_id() method on MySQL's mysql_insert_id function, so as far as DBI
is concerned, I think $dbh->last_insert_id() does the Right Thing.

In the original context though, this bug plus recent discussion on #koha about
table-locking issues with fixup_cardnumber is making me think that what we
*really* need is a small module for simulating true sequences so that one can
simply do something like

my $num = Koha::Database::Sequence->get_next_val($sequence_name);

The idea is that the module and the code backing it would provide the ability
to create a sequence with a specified name, then fetch values from it that are
guaranteed to be unique.

I'll poke at this.

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


More information about the Koha-bugs mailing list