mod_storage_sql2: Fix another SQL syntax error that slipped trough
authorKim Alvefur <zash@zash.se>
Mon, 20 Jan 2014 23:51:31 +0000 (00:51 +0100)
committerKim Alvefur <zash@zash.se>
Mon, 20 Jan 2014 23:51:31 +0000 (00:51 +0100)
plugins/mod_storage_sql2.lua

index b9e9d3cad4c9879eea16807b82e13f432177ac1f..e02ad68148e22a1ea626b664337312e7f29480f2 100644 (file)
@@ -224,7 +224,7 @@ function archive_store:append(username, key, when, with, value)
        return engine:transaction(function()
                local key = key or uuid.generate();
                local t, value = serialize(value);
-               engine:delete("DELETE FROM `prosodyarchive` WHERE `host`=? AND `user`=? AND `store`=? AND KEY=?", host, user or "", store, key);
+               engine:delete("DELETE FROM `prosodyarchive` WHERE `host`=? AND `user`=? AND `store`=? AND `key`=?", host, user or "", store, key);
                engine:insert("INSERT INTO `prosodyarchive` (`host`, `user`, `store`, `when`, `with`, `key`, `type`, `value`) VALUES (?,?,?,?,?,?,?,?)", host, user or "", store, when, with, key, t, value);
                return key;
        end);