From 58b2b1dbef0b5f9b914d861e32ee12ad8c52bdf4 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 12 May 2017 06:30:45 +0000 Subject: [PATCH] Some more cleaner delete --- include/items.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) 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 -- 2.39.5