From: Michael Date: Fri, 12 May 2017 06:30:45 +0000 (+0000) Subject: Some more cleaner delete X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=58b2b1dbef0b5f9b914d861e32ee12ad8c52bdf4;p=friendica.git Some more cleaner delete --- diff --git a/include/items.php b/include/items.php index 3b790b6a12..0033deceaf 100644 --- a/include/items.php +++ b/include/items.php @@ -1377,10 +1377,7 @@ function tag_deliver($uid, $item_id) { // mmh.. no mention.. community page or private group... no wall.. no origin.. top-post (not a comment) // delete it! logger("tag_deliver: no-mention top-level post to communuty or private group. delete."); - q("DELETE FROM item WHERE id = %d and uid = %d", - intval($item_id), - intval($uid) - ); + dba::delete('item', array('id' => $item_id)); return true; } return; @@ -2236,23 +2233,6 @@ function drop_item($id, $interactive = true) { // ignore the result } - - // clean up item_id and sign meta-data tables - - /* - /// @TODO Old code - caused very long queries and warning entries in the mysql logfiles: - - $r = q("DELETE FROM item_id where iid in (select id from item where parent = %d and uid = %d)", - intval($item['id']), - intval($item['uid']) - ); - - $r = q("DELETE FROM sign where iid in (select id from item where parent = %d and uid = %d)", - intval($item['id']), - intval($item['uid']) - ); - */ - // The new code splits the queries since the mysql optimizer really has bad problems with subqueries // Creating list of parents