aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-05-18 00:23:35 +0100
committerJustin Clark-Casey (justincc)2011-05-18 00:23:35 +0100
commit6dcc87b1adeb71a9c83cafa95a95a80c50b62092 (patch)
treef6a395bb05f3f5f3bb0bf05cd08e1d66aba7fcac /OpenSim/Data/MySQL
parentcorrect small mistake in "delete object name <name>" usage summary (diff)
downloadopensim-SC_OLD-6dcc87b1adeb71a9c83cafa95a95a80c50b62092.zip
opensim-SC_OLD-6dcc87b1adeb71a9c83cafa95a95a80c50b62092.tar.gz
opensim-SC_OLD-6dcc87b1adeb71a9c83cafa95a95a80c50b62092.tar.bz2
opensim-SC_OLD-6dcc87b1adeb71a9c83cafa95a95a80c50b62092.tar.xz
Accidentally committed too early
Revert "Allow item links to be deleted even when other deletes and purges are disabled." This reverts commit 491279f99afc65860d44765ee7829c7dd5e4e38e.
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLGenericTableHandler.cs27
-rw-r--r--OpenSim/Data/MySQL/MySQLXInventoryData.cs10
2 files changed, 6 insertions, 31 deletions
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
264 } 264 }
265 } 265 }
266 266
267 public virtual bool Delete(string field, string key) 267 public virtual bool Delete(string field, string val)
268 { 268 {
269 return Delete(new string[] { field }, new string[] { key });
270 }
271
272 public virtual bool Delete(string[] fields, string[] keys)
273 {
274 if (fields.Length != keys.Length)
275 return false;
276
277 List<string> terms = new List<string>();
278
279 using (MySqlCommand cmd = new MySqlCommand()) 269 using (MySqlCommand cmd = new MySqlCommand())
280 { 270 {
281 for (int i = 0 ; i < fields.Length ; i++)
282 {
283 cmd.Parameters.AddWithValue(fields[i], keys[i]);
284 terms.Add("`" + fields[i] + "` = ?" + fields[i]);
285 }
286
287 string where = String.Join(" and ", terms.ToArray());
288 271
289 string query = String.Format("delete from {0} where {1}", m_Realm, where); 272 cmd.CommandText = String.Format("delete from {0} where `{1}` = ?{1}", m_Realm, field);
273 cmd.Parameters.AddWithValue(field, val);
290 274
291 cmd.CommandText = query; 275 if (ExecuteNonQuery(cmd) > 0)
276 return true;
292 277
293 return ExecuteNonQuery(cmd) > 0; 278 return false;
294 } 279 }
295 } 280 }
296 } 281 }
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
85 return m_Folders.Delete(field, val); 85 return m_Folders.Delete(field, val);
86 } 86 }
87 87
88 public bool DeleteFolders(string[] fields, string[] vals)
89 {
90 return m_Folders.Delete(fields, vals);
91 }
92
93 public bool DeleteItems(string field, string val) 88 public bool DeleteItems(string field, string val)
94 { 89 {
95 return m_Items.Delete(field, val); 90 return m_Items.Delete(field, val);
96 } 91 }
97 92
98 public bool DeleteItems(string[] fields, string[] vals)
99 {
100 return m_Items.Delete(fields, vals);
101 }
102
103 public bool MoveItem(string id, string newParent) 93 public bool MoveItem(string id, string newParent)
104 { 94 {
105 return m_Items.MoveItem(id, newParent); 95 return m_Items.MoveItem(id, newParent);