From 330182f195589c884644e98d3b51e2d0a200de7d Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 13 Apr 2011 11:57:54 -0700 Subject: [PATCH] Fix an issue with non-integer custom keys in Lisk. --- src/storage/lisk/dao/LiskDAO.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storage/lisk/dao/LiskDAO.php b/src/storage/lisk/dao/LiskDAO.php index 69d5cfae1a..27443235fd 100644 --- a/src/storage/lisk/dao/LiskDAO.php +++ b/src/storage/lisk/dao/LiskDAO.php @@ -741,12 +741,13 @@ abstract class LiskDAO { } $this->setVersion($this->getVersion() + 1); } else { + $id = $this->getID(); $conn->query( - 'UPDATE %T SET %Q WHERE %C = %d', + 'UPDATE %T SET %Q WHERE %C = '.(is_int($id) ? '%d' : '%s'), $this->getTableName(), $map, $this->getIDKeyForUse(), - $this->getID()); + $id); // We can't detect a missing object because updating an object without // changing any values doesn't affect rows. We could jiggle timestamps // to catch this for objects which track them if we wanted.