Skip to content

Commit 6321130

Browse files
author
jessevz
committed
Fixed bug in legacy agentbinary update, by directly performing update logic in order to skip get() which result in bug
1 parent d6444f1 commit 6321130

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/inc/Util.class.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,16 @@ public static function checkAgentVersionLegacy($type, $version, $silent = false)
216216
if (!$silent) {
217217
echo "update $type version... ";
218218
}
219-
Factory::getAgentBinaryFactory()->set($binary, AgentBinary::VERSION, $version);
219+
220+
$query = "UPDATE " . $agentBinaryFactory->getModelTable() . " SET " . AgentBinary::VERSION . "=?";
221+
222+
$values = [];
223+
$query = $query . " WHERE " . $binary->getPrimaryKey() . "=?";
224+
$values[] = $version;
225+
$values[] = $binary->getPrimaryKeyValue();
226+
227+
$stmt = $dbh->prepare($query);
228+
$stmt->execute($values);
220229
if (!$silent) {
221230
echo "OK";
222231
}

0 commit comments

Comments
 (0)