Bug 4141 Reconcile 3.0.x and HEAD database updates for 3.2.0

This is a partial fix addressing this error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at /home/koha/koha.prod/installer/data/mysql/updatedatabase.pl line 2916., referer: http://koha-staff.foobar.org/cgi-bin/koha/installer/install.pl

If there are no records in aqbudgets the result is an empty array which causes the sql to attempt to set AUTOINCREMENT to null.

This patch is being submitted on behalf of the Mapua Community Library.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Chris Nighswonger 2010-05-12 08:00:50 -04:00 committed by Galen Charlton
parent dd1ad2d3eb
commit 72cc96c1eb
1 changed files with 2 additions and 0 deletions

View File

@ -2913,6 +2913,8 @@ BUDGETNAME
SELECT MAX(aqbudgetid) from aqbudgets
IDsBUDGET
$$maxbudgetid[0] = 0 if !$$maxbudgetid[0];
$dbh->do(<<BUDGETAUTOINCREMENT);
ALTER TABLE `aqbudgets` AUTO_INCREMENT=$$maxbudgetid[0]
BUDGETAUTOINCREMENT