diff options
author | Justin Clark-Casey (justincc) | 2011-05-18 00:23:35 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-05-18 00:23:35 +0100 |
commit | 6dcc87b1adeb71a9c83cafa95a95a80c50b62092 (patch) | |
tree | f6a395bb05f3f5f3bb0bf05cd08e1d66aba7fcac /OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | |
parent | correct small mistake in "delete object name <name>" usage summary (diff) | |
download | opensim-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/SQLite/SQLiteGenericTableHandler.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | 28 |
1 files changed, 6 insertions, 22 deletions
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 | |||
258 | return false; | 258 | return false; |
259 | } | 259 | } |
260 | 260 | ||
261 | public virtual bool Delete(string field, string key) | 261 | public bool Delete(string field, string val) |
262 | { | 262 | { |
263 | return Delete(new string[] { field }, new string[] { key }); | ||
264 | } | ||
265 | |||
266 | public bool Delete(string[] fields, string[] keys) | ||
267 | { | ||
268 | if (fields.Length != keys.Length) | ||
269 | return false; | ||
270 | |||
271 | List<string> terms = new List<string>(); | ||
272 | |||
273 | SqliteCommand cmd = new SqliteCommand(); | 263 | SqliteCommand cmd = new SqliteCommand(); |
274 | 264 | ||
275 | for (int i = 0 ; i < fields.Length ; i++) | 265 | cmd.CommandText = String.Format("delete from {0} where `{1}` = :{1}", m_Realm, field); |
276 | { | 266 | cmd.Parameters.Add(new SqliteParameter(field, val)); |
277 | cmd.Parameters.Add(new SqliteParameter(":" + fields[i], keys[i])); | ||
278 | terms.Add("`" + fields[i] + "` = :" + fields[i]); | ||
279 | } | ||
280 | |||
281 | string where = String.Join(" and ", terms.ToArray()); | ||
282 | |||
283 | string query = String.Format("delete * from {0} where {1}", m_Realm, where); | ||
284 | 267 | ||
285 | cmd.CommandText = query; | 268 | if (ExecuteNonQuery(cmd, m_Connection) > 0) |
269 | return true; | ||
286 | 270 | ||
287 | return ExecuteNonQuery(cmd, m_Connection) > 0; | 271 | return false; |
288 | } | 272 | } |
289 | } | 273 | } |
290 | } | 274 | } |