diff options
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/AssetDataBase.cs | 1 | ||||
-rw-r--r-- | OpenSim/Data/IAssetData.cs | 1 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLAssetData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 18 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 34 | ||||
-rw-r--r-- | OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs | 6 |
6 files changed, 49 insertions, 15 deletions
diff --git a/OpenSim/Data/AssetDataBase.cs b/OpenSim/Data/AssetDataBase.cs index 5deb44e..e1a810c 100644 --- a/OpenSim/Data/AssetDataBase.cs +++ b/OpenSim/Data/AssetDataBase.cs | |||
@@ -48,5 +48,6 @@ namespace OpenSim.Data | |||
48 | public abstract void Initialise(string connect); | 48 | public abstract void Initialise(string connect); |
49 | public abstract void Initialise(); | 49 | public abstract void Initialise(); |
50 | public abstract void Dispose(); | 50 | public abstract void Dispose(); |
51 | public abstract bool Delete(string id); | ||
51 | } | 52 | } |
52 | } | 53 | } |
diff --git a/OpenSim/Data/IAssetData.cs b/OpenSim/Data/IAssetData.cs index 2149bca..90d5eeb 100644 --- a/OpenSim/Data/IAssetData.cs +++ b/OpenSim/Data/IAssetData.cs | |||
@@ -38,6 +38,7 @@ namespace OpenSim.Data | |||
38 | bool ExistsAsset(UUID uuid); | 38 | bool ExistsAsset(UUID uuid); |
39 | List<AssetMetadata> FetchAssetMetadataSet(int start, int count); | 39 | List<AssetMetadata> FetchAssetMetadataSet(int start, int count); |
40 | void Initialise(string connect); | 40 | void Initialise(string connect); |
41 | bool Delete(string id); | ||
41 | } | 42 | } |
42 | 43 | ||
43 | public class AssetDataInitialiser : PluginInitialiserBase | 44 | public class AssetDataInitialiser : PluginInitialiserBase |
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index d6ea262..8475b22 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -322,6 +322,10 @@ namespace OpenSim.Data.MSSQL | |||
322 | return retList; | 322 | return retList; |
323 | } | 323 | } |
324 | 324 | ||
325 | public override bool Delete(string id) | ||
326 | { | ||
327 | return false; | ||
328 | } | ||
325 | #endregion | 329 | #endregion |
326 | } | 330 | } |
327 | } | 331 | } |
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 5a2af4f..35eed56 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -338,6 +338,24 @@ namespace OpenSim.Data.MySQL | |||
338 | return retList; | 338 | return retList; |
339 | } | 339 | } |
340 | 340 | ||
341 | public override bool Delete(string id) | ||
342 | { | ||
343 | lock (m_dbLock) | ||
344 | { | ||
345 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
346 | { | ||
347 | dbcon.Open(); | ||
348 | MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id"); | ||
349 | cmd.Parameters.AddWithValue("?id", id); | ||
350 | cmd.ExecuteNonQuery(); | ||
351 | |||
352 | cmd.Dispose(); | ||
353 | } | ||
354 | } | ||
355 | |||
356 | return true; | ||
357 | } | ||
358 | |||
341 | #endregion | 359 | #endregion |
342 | } | 360 | } |
343 | } | 361 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 636bf86..2783ba1 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -208,20 +208,6 @@ namespace OpenSim.Data.SQLite | |||
208 | } | 208 | } |
209 | 209 | ||
210 | /// <summary> | 210 | /// <summary> |
211 | /// Delete an asset from database | ||
212 | /// </summary> | ||
213 | /// <param name="uuid"></param> | ||
214 | public void DeleteAsset(UUID uuid) | ||
215 | { | ||
216 | using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn)) | ||
217 | { | ||
218 | cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString())); | ||
219 | |||
220 | cmd.ExecuteNonQuery(); | ||
221 | } | ||
222 | } | ||
223 | |||
224 | /// <summary> | ||
225 | /// | 211 | /// |
226 | /// </summary> | 212 | /// </summary> |
227 | /// <param name="row"></param> | 213 | /// <param name="row"></param> |
@@ -338,6 +324,26 @@ namespace OpenSim.Data.SQLite | |||
338 | get { return "SQLite Asset storage engine"; } | 324 | get { return "SQLite Asset storage engine"; } |
339 | } | 325 | } |
340 | 326 | ||
327 | public override bool Delete(string id) | ||
328 | { | ||
329 | UUID assetID; | ||
330 | |||
331 | if (!UUID.TryParse(id, out assetID)) | ||
332 | return false; | ||
333 | |||
334 | lock (this) | ||
335 | { | ||
336 | using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn)) | ||
337 | { | ||
338 | cmd.Parameters.Add(new SqliteParameter(":UUID", assetID.ToString())); | ||
339 | |||
340 | cmd.ExecuteNonQuery(); | ||
341 | } | ||
342 | } | ||
343 | |||
344 | return true; | ||
345 | } | ||
346 | |||
341 | #endregion | 347 | #endregion |
342 | } | 348 | } |
343 | } | 349 | } |
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs index 0d63dea..df50902 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs | |||
@@ -338,6 +338,10 @@ namespace OpenSim.Data.SQLiteLegacy | |||
338 | get { return "SQLite Asset storage engine"; } | 338 | get { return "SQLite Asset storage engine"; } |
339 | } | 339 | } |
340 | 340 | ||
341 | public override bool Delete(string id) | ||
342 | { | ||
343 | return false; | ||
344 | } | ||
341 | #endregion | 345 | #endregion |
342 | } | 346 | } |
343 | } \ No newline at end of file | 347 | } |