summaryrefslogtreecommitdiffstats
path: root/config-db/OpenSLX/MetaDB/DBI.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-07-17 22:46:07 +0200
committerOliver Tappe2008-07-17 22:46:07 +0200
commitc79039f8679f7a77032f0b81a82771e616f4e704 (patch)
treeaf3680fc7d96d25c43ab35153cd6f839a52ef289 /config-db/OpenSLX/MetaDB/DBI.pm
parent* fixed bad bug that would cause removal of vendor-OS if the export was (diff)
downloadcore-c79039f8679f7a77032f0b81a82771e616f4e704.tar.gz
core-c79039f8679f7a77032f0b81a82771e616f4e704.tar.xz
core-c79039f8679f7a77032f0b81a82771e616f4e704.zip
Fixed two more problems exposed by mysql:
* non-numeric IDs (like in the global_info table) were not handled properly * mysql needs to auto-reconnect to bypass problems related to forking while database connections are kept open git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1934 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/OpenSLX/MetaDB/DBI.pm')
-rw-r--r--config-db/OpenSLX/MetaDB/DBI.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/config-db/OpenSLX/MetaDB/DBI.pm b/config-db/OpenSLX/MetaDB/DBI.pm
index 4bb8ce88..a5a8e68e 100644
--- a/config-db/OpenSLX/MetaDB/DBI.pm
+++ b/config-db/OpenSLX/MetaDB/DBI.pm
@@ -559,11 +559,12 @@ sub _doInsert
$valRow->{'id'} = $lastID;
vlog(3, "DB-generated id for <$table> is <$valRow->{id}>");
}
- elsif ($valRow->{'id'} != $lastID) {
+ elsif ($valRow->{'id'} ne $lastID) {
# id has been pre-specified, but DB changed it, so we update
# it with the pre-specified value
- my $sql2
- = "UPDATE $table SET id=$valRow->{'id'} WHERE id=$lastID";
+ my $sql2 = unshiftHereDoc(<<" End-of-Here");
+ UPDATE $table SET id='$valRow->{'id'}' WHERE id='$lastID'
+ End-of-Here
vlog(3, $sql2);
$dbh->do($sql2) or croak _tr(
q[Can't update table <%s> (%s)], $table, $dbh->errstr