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/SQLite/SQLiteGenericTableHandler.cs | 28 +++++------------------- OpenSim/Data/SQLite/SQLiteXInventoryData.cs | 10 --------- 2 files changed, 6 insertions(+), 32 deletions(-) (limited to 'OpenSim/Data/SQLite') diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs index 3fb2d3f..0d7b001 100644 --- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs +++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs @@ -258,33 +258,17 @@ namespace OpenSim.Data.SQLite return false; } - public virtual bool Delete(string field, string key) + public bool Delete(string field, string val) { - return Delete(new string[] { field }, new string[] { key }); - } - - public bool Delete(string[] fields, string[] keys) - { - if (fields.Length != keys.Length) - return false; - - List terms = new List(); - SqliteCommand cmd = new SqliteCommand(); - for (int i = 0 ; i < fields.Length ; i++) - { - cmd.Parameters.Add(new SqliteParameter(":" + 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.Add(new SqliteParameter(field, val)); - cmd.CommandText = query; + if (ExecuteNonQuery(cmd, m_Connection) > 0) + return true; - return ExecuteNonQuery(cmd, m_Connection) > 0; + return false; } } } diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index 02edc30..ccbd86e 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs @@ -91,21 +91,11 @@ namespace OpenSim.Data.SQLite 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