aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/AssetDataBase.cs2
-rw-r--r--OpenSim/Data/IAssetData.cs2
-rw-r--r--OpenSim/Data/IUserAccountData.cs1
-rw-r--r--OpenSim/Data/MSSQL/MSSQLAssetData.cs4
-rw-r--r--OpenSim/Data/MSSQL/MSSQLUserAccountData.cs5
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs4
-rw-r--r--OpenSim/Data/MySQL/MySQLUserAccountData.cs15
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations2
-rw-r--r--OpenSim/Data/Null/NullUserAccountData.cs5
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs4
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserAccountData.cs5
-rw-r--r--OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs4
-rw-r--r--OpenSim/Data/SQLiteLegacy/SQLiteUserAccountData.cs5
13 files changed, 51 insertions, 7 deletions
diff --git a/OpenSim/Data/AssetDataBase.cs b/OpenSim/Data/AssetDataBase.cs
index e1a810c..b4ae913 100644
--- a/OpenSim/Data/AssetDataBase.cs
+++ b/OpenSim/Data/AssetDataBase.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Data
38 { 38 {
39 public abstract AssetBase GetAsset(UUID uuid); 39 public abstract AssetBase GetAsset(UUID uuid);
40 40
41 public abstract void StoreAsset(AssetBase asset); 41 public abstract bool StoreAsset(AssetBase asset);
42 public abstract bool ExistsAsset(UUID uuid); 42 public abstract bool ExistsAsset(UUID uuid);
43 43
44 public abstract List<AssetMetadata> FetchAssetMetadataSet(int start, int count); 44 public abstract List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
diff --git a/OpenSim/Data/IAssetData.cs b/OpenSim/Data/IAssetData.cs
index f31b215c..0c8eadd 100644
--- a/OpenSim/Data/IAssetData.cs
+++ b/OpenSim/Data/IAssetData.cs
@@ -34,7 +34,7 @@ namespace OpenSim.Data
34 public interface IAssetDataPlugin : IPlugin 34 public interface IAssetDataPlugin : IPlugin
35 { 35 {
36 AssetBase GetAsset(UUID uuid); 36 AssetBase GetAsset(UUID uuid);
37 void StoreAsset(AssetBase asset); 37 bool StoreAsset(AssetBase asset);
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);
diff --git a/OpenSim/Data/IUserAccountData.cs b/OpenSim/Data/IUserAccountData.cs
index 906ba6c..bc7eda7 100644
--- a/OpenSim/Data/IUserAccountData.cs
+++ b/OpenSim/Data/IUserAccountData.cs
@@ -50,5 +50,6 @@ namespace OpenSim.Data
50 bool Store(UserAccountData data); 50 bool Store(UserAccountData data);
51 bool Delete(string field, string val); 51 bool Delete(string field, string val);
52 UserAccountData[] GetUsers(UUID scopeID, string query); 52 UserAccountData[] GetUsers(UUID scopeID, string query);
53 UserAccountData[] GetUsersWhere(UUID scopeID, string where);
53 } 54 }
54} 55}
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs
index c7488d8..c882555 100644
--- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs
@@ -143,7 +143,7 @@ namespace OpenSim.Data.MSSQL
143 /// Create asset in m_database 143 /// Create asset in m_database
144 /// </summary> 144 /// </summary>
145 /// <param name="asset">the asset</param> 145 /// <param name="asset">the asset</param>
146 override public void StoreAsset(AssetBase asset) 146 override public bool StoreAsset(AssetBase asset)
147 { 147 {
148 148
149 string sql = 149 string sql =
@@ -192,10 +192,12 @@ namespace OpenSim.Data.MSSQL
192 try 192 try
193 { 193 {
194 command.ExecuteNonQuery(); 194 command.ExecuteNonQuery();
195 return true;
195 } 196 }
196 catch(Exception e) 197 catch(Exception e)
197 { 198 {
198 m_log.Error("[ASSET DB]: Error storing item :" + e.Message); 199 m_log.Error("[ASSET DB]: Error storing item :" + e.Message);
200 return false;
199 } 201 }
200 } 202 }
201 } 203 }
diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
index e7c8dc5..f24b441 100644
--- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
@@ -238,5 +238,10 @@ namespace OpenSim.Data.MSSQL
238 return DoQuery(cmd); 238 return DoQuery(cmd);
239 } 239 }
240 } 240 }
241
242 public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
243 {
244 return null;
245 }
241 } 246 }
242} 247}
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index ed92f3e..0b0a638 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -153,7 +153,7 @@ namespace OpenSim.Data.MySQL
153 /// </summary> 153 /// </summary>
154 /// <param name="asset">Asset UUID to create</param> 154 /// <param name="asset">Asset UUID to create</param>
155 /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks> 155 /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
156 override public void StoreAsset(AssetBase asset) 156 override public bool StoreAsset(AssetBase asset)
157 { 157 {
158 lock (m_dbLock) 158 lock (m_dbLock)
159 { 159 {
@@ -201,12 +201,14 @@ namespace OpenSim.Data.MySQL
201 cmd.Parameters.AddWithValue("?data", asset.Data); 201 cmd.Parameters.AddWithValue("?data", asset.Data);
202 cmd.ExecuteNonQuery(); 202 cmd.ExecuteNonQuery();
203 cmd.Dispose(); 203 cmd.Dispose();
204 return true;
204 } 205 }
205 } 206 }
206 catch (Exception e) 207 catch (Exception e)
207 { 208 {
208 m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}", 209 m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
209 asset.FullID, asset.Name, e.Message); 210 asset.FullID, asset.Name, e.Message);
211 return false;
210 } 212 }
211 } 213 }
212 } 214 }
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
index aa69d68..3b35222 100644
--- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
@@ -80,5 +80,20 @@ namespace OpenSim.Data.MySQL
80 80
81 return DoQuery(cmd); 81 return DoQuery(cmd);
82 } 82 }
83
84 public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
85 {
86 MySqlCommand cmd = new MySqlCommand();
87
88 if (scopeID != UUID.Zero)
89 {
90 where = "(ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (" + where + ")";
91 cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString());
92 }
93
94 cmd.CommandText = String.Format("select * from {0} where " + where, m_Realm);
95
96 return DoQuery(cmd);
97 }
83 } 98 }
84} 99}
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index ba8d538..645f4e8 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -717,7 +717,7 @@ ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT
717 717
718COMMIT; 718COMMIT;
719 719
720:VERSION 32 720:VERSION 32 #---------------------
721 721
722BEGIN; 722BEGIN;
723CREATE TABLE `regionwindlight` ( 723CREATE TABLE `regionwindlight` (
diff --git a/OpenSim/Data/Null/NullUserAccountData.cs b/OpenSim/Data/Null/NullUserAccountData.cs
index ede23fb..772d821 100644
--- a/OpenSim/Data/Null/NullUserAccountData.cs
+++ b/OpenSim/Data/Null/NullUserAccountData.cs
@@ -156,5 +156,10 @@ namespace OpenSim.Data.Null
156 156
157 return false; 157 return false;
158 } 158 }
159
160 public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
161 {
162 return null;
163 }
159 } 164 }
160} 165}
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 5b71897..9a4eb76 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -124,7 +124,7 @@ namespace OpenSim.Data.SQLite
124 /// Create an asset 124 /// Create an asset
125 /// </summary> 125 /// </summary>
126 /// <param name="asset">Asset Base</param> 126 /// <param name="asset">Asset Base</param>
127 override public void StoreAsset(AssetBase asset) 127 override public bool StoreAsset(AssetBase asset)
128 { 128 {
129 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); 129 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
130 if (ExistsAsset(asset.FullID)) 130 if (ExistsAsset(asset.FullID))
@@ -146,6 +146,7 @@ namespace OpenSim.Data.SQLite
146 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); 146 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
147 147
148 cmd.ExecuteNonQuery(); 148 cmd.ExecuteNonQuery();
149 return true;
149 } 150 }
150 } 151 }
151 } 152 }
@@ -166,6 +167,7 @@ namespace OpenSim.Data.SQLite
166 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); 167 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
167 168
168 cmd.ExecuteNonQuery(); 169 cmd.ExecuteNonQuery();
170 return true;
169 } 171 }
170 } 172 }
171 } 173 }
diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
index 7a5de50..4d580c0 100644
--- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
@@ -81,5 +81,10 @@ namespace OpenSim.Data.SQLite
81 81
82 return DoQuery(cmd); 82 return DoQuery(cmd);
83 } 83 }
84
85 public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
86 {
87 return null;
88 }
84 } 89 }
85} 90}
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs
index df50902..3da298b 100644
--- a/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs
@@ -119,7 +119,7 @@ namespace OpenSim.Data.SQLiteLegacy
119 /// Create an asset 119 /// Create an asset
120 /// </summary> 120 /// </summary>
121 /// <param name="asset">Asset Base</param> 121 /// <param name="asset">Asset Base</param>
122 override public void StoreAsset(AssetBase asset) 122 override public bool StoreAsset(AssetBase asset)
123 { 123 {
124 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); 124 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
125 if (ExistsAsset(asset.FullID)) 125 if (ExistsAsset(asset.FullID))
@@ -139,6 +139,7 @@ namespace OpenSim.Data.SQLiteLegacy
139 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); 139 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
140 140
141 cmd.ExecuteNonQuery(); 141 cmd.ExecuteNonQuery();
142 return true;
142 } 143 }
143 } 144 }
144 } 145 }
@@ -157,6 +158,7 @@ namespace OpenSim.Data.SQLiteLegacy
157 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); 158 cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
158 159
159 cmd.ExecuteNonQuery(); 160 cmd.ExecuteNonQuery();
161 return true;
160 } 162 }
161 } 163 }
162 } 164 }
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteUserAccountData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteUserAccountData.cs
index 27553c6..41a0177 100644
--- a/OpenSim/Data/SQLiteLegacy/SQLiteUserAccountData.cs
+++ b/OpenSim/Data/SQLiteLegacy/SQLiteUserAccountData.cs
@@ -77,5 +77,10 @@ namespace OpenSim.Data.SQLiteLegacy
77 77
78 return DoQuery(cmd); 78 return DoQuery(cmd);
79 } 79 }
80
81 public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
82 {
83 return null;
84 }
80 } 85 }
81} 86}