Commit be7b3270 authored by Manfred Kutas's avatar Manfred Kutas

ZP-230 Fixed update statement in SetState. Null values weren't handled

properly.

Released under the Affero GNU General Public License (AGPL) version 3.
parent ba39da19
......@@ -247,7 +247,7 @@ class SqlStateMachine implements IStateMachine {
}
else {
// Existing record, we update it
$sql = "update zpush_states set state_data = :data, updated_at = :updated_at where device_id = :devid and state_type = :type and uuid = :key and counter = :counter";
$sql = "update zpush_states set state_data = :data, updated_at = :updated_at where device_id = :devid and state_type = :type and uuid " . (($key == null) ? " is " : " = ") .":key and counter = :counter";
$sth = $this->dbh->prepare($sql);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment