fixing a bug in the way that max is generated when finding the next
borrowernumber. Now, using mysql 4.1 we can convert to an integer to get an accurate next value.
This commit is contained in:
parent
50a375cdd9
commit
056dfd10db
|
|
@ -259,7 +259,10 @@ sub fixup_cardnumber ($) {
|
|||
|
||||
$cardnumber="V$cardnumber$rem";
|
||||
} else {
|
||||
my $sth=$dbh->prepare("select max(borrowers.cardnumber) from borrowers");
|
||||
# MODIFIED BY JF: mysql4.1 allows casting as an integer, which is probably
|
||||
# better. I'll leave the original in in case it needs to be changed for you
|
||||
my $sth=$dbh->prepare("select max(cast(cardnumber as signed)) from borrowers");
|
||||
#my $sth=$dbh->prepare("select max(borrowers.cardnumber) from borrowers");
|
||||
$sth->execute;
|
||||
|
||||
my ($result)=$sth->fetchrow;
|
||||
|
|
|
|||
Loading…
Reference in New Issue