From 6dcc87b1adeb71a9c83cafa95a95a80c50b62092 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 18 May 2011 00:23:35 +0100 Subject: Accidentally committed too early Revert "Allow item links to be deleted even when other deletes and purges are disabled." This reverts commit 491279f99afc65860d44765ee7829c7dd5e4e38e. --- OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | 27 ++++++-------------------- OpenSim/Data/MySQL/MySQLXInventoryData.cs | 10 ---------- 2 files changed, 6 insertions(+), 31 deletions(-) (limited to 'OpenSim/Data/MySQL') diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs index 754cf72..cfffbd8 100644 --- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs +++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs @@ -264,33 +264,18 @@ namespace OpenSim.Data.MySQL } } - public virtual bool Delete(string field, string key) + public virtual bool Delete(string field, string val) { - return Delete(new string[] { field }, new string[] { key }); - } - - public virtual bool Delete(string[] fields, string[] keys) - { - if (fields.Length != keys.Length) - return false; - - List terms = new List(); - using (MySqlCommand cmd = new MySqlCommand()) { - for (int i = 0 ; i < fields.Length ; i++) - { - cmd.Parameters.AddWithValue(fields[i], keys[i]); - terms.Add("`" + fields[i] + "` = ?" + fields[i]); - } - - string where = String.Join(" and ", terms.ToArray()); - string query = String.Format("delete from {0} where {1}", m_Realm, where); + cmd.CommandText = String.Format("delete from {0} where `{1}` = ?{1}", m_Realm, field); + cmd.Parameters.AddWithValue(field, val); - cmd.CommandText = query; + if (ExecuteNonQuery(cmd) > 0) + return true; - return ExecuteNonQuery(cmd) > 0; + return false; } } } diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs index caf18a4..481da49 100644 --- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs @@ -85,21 +85,11 @@ namespace OpenSim.Data.MySQL return m_Folders.Delete(field, val); } - public bool DeleteFolders(string[] fields, string[] vals) - { - return m_Folders.Delete(fields, vals); - } - public bool DeleteItems(string field, string val) { return m_Items.Delete(field, val); } - public bool DeleteItems(string[] fields, string[] vals) - { - return m_Items.Delete(fields, vals); - } - public bool MoveItem(string id, string newParent) { return m_Items.MoveItem(id, newParent); -- cgit v1.1