summaryrefslogtreecommitdiffstats
path: root/config-db/OpenSLX
diff options
context:
space:
mode:
authorOliver Tappe2007-04-11 17:48:34 +0200
committerOliver Tappe2007-04-11 17:48:34 +0200
commit50f7ac23d071d6598eef0d8807025526a2518888 (patch)
treee5ab0644e3b5c867627f1b65dfa1483a05acbe02 /config-db/OpenSLX
parent* removed 'use_absolute_tftp' from settings table (diff)
downloadcore-50f7ac23d071d6598eef0d8807025526a2518888.tar.gz
core-50f7ac23d071d6598eef0d8807025526a2518888.tar.xz
core-50f7ac23d071d6598eef0d8807025526a2518888.zip
* circumvent problem with older versions of DBD::CSV not supporting the max()-function
(this caused problems on SUSE-9.3). git-svn-id: http://svn.openslx.org/svn/openslx/trunk@874 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/OpenSLX')
-rw-r--r--config-db/OpenSLX/MetaDB/CSV.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/config-db/OpenSLX/MetaDB/CSV.pm b/config-db/OpenSLX/MetaDB/CSV.pm
index 80e9f6d5..4057355e 100644
--- a/config-db/OpenSLX/MetaDB/CSV.pm
+++ b/config-db/OpenSLX/MetaDB/CSV.pm
@@ -100,7 +100,15 @@ sub generateNextIdForTable
if (!$nextID) {
# no ID information available, we protect against users having
# deleted the ID-file by fetching the highest ID from the DB:
- $nextID = 1+$self->_doSelect("SELECT max(id) AS id FROM $table", 'id');
+ #
+ # N.B.: older versions of DBD::CSV (notably the one that comes with
+ # SUSE-9.3) do not understand the max() function, so we determine
+ # the maximum ID manually:
+ my @IDs
+ = sort { $b <=> $a }
+ $self->_doSelect("SELECT id FROM $table", 'id');
+ my $maxID = $IDs[0];
+ $nextID = 1+$maxID;
}
seek(IDFILE, 0, 0)
or confess _tr(q[Can't to seek ID-file <%s> (%s)], $idFile, $!);