From 056dfd10db0a2c6db46bd2820d6959ddd2d24ad7 Mon Sep 17 00:00:00 2001 From: kados Date: Mon, 3 Apr 2006 23:43:20 +0000 Subject: [PATCH] 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. --- C4/Members.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Members.pm b/C4/Members.pm index 5f88ab3c3e..5cc88abb0c 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -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; -- 2.39.5