Accidentally committed too early

Revert "Allow item links to be deleted even when other deletes and purges are disabled."

This reverts commit 491279f99a.
This commit is contained in:
Justin Clark-Casey (justincc)
2011-05-18 00:23:35 +01:00
parent c562b9ef19
commit 6dcc87b1ad
8 changed files with 30 additions and 149 deletions

View File

@@ -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<string> terms = new List<string>();
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());
cmd.CommandText = String.Format("delete from {0} where `{1}` = ?{1}", m_Realm, field);
cmd.Parameters.AddWithValue(field, val);
string query = String.Format("delete from {0} where {1}", m_Realm, where);
if (ExecuteNonQuery(cmd) > 0)
return true;
cmd.CommandText = query;
return ExecuteNonQuery(cmd) > 0;
return false;
}
}
}