From 540b41055b11b04a861c607cd7c72ce831e7c3bf Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 7 Jan 2016 00:13:01 +0100 Subject: [PATCH] Replace REPLACE INTO with INSERT INTO, take 2: now without a dumb typo. --- weave_storage.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/weave_storage.php b/weave_storage.php index 9afaa9a..caf0acd 100644 --- a/weave_storage.php +++ b/weave_storage.php @@ -220,8 +220,12 @@ class WeaveStorage try { - $insert_stmt = 'replace into wbo (username, id, collection, parentid, predecessorid, sortindex, modified, payload, payload_size) - values (:username, :id, :collection, :parentid, :predecessorid, :sortindex, :modified, :payload, :payload_size)'; + $insert_stmt = 'insert into wbo (username, id, collection, parentid, predecessorid, sortindex, modified, payload, payload_size) + values (:username, :id, :collection, :parentid, :predecessorid, :sortindex, :modified, :payload, :payload_size) + on duplicate key update + username=values(username), id=values(id), collection=values(collection), parentid=values(parentid), + predecessorid=values(predecessorid), sortindex=values(sortindex), modified=values(modified), payload=values(payload), + payload_size=values(payload_size)'; $sth = $this->_dbh->prepare($insert_stmt); $username = $this->_username;