aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data')
-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.cs17
-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, 52 insertions, 8 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 e740232..94e2da4 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Data.MySQL
155 /// </summary> 155 /// </summary>
156 /// <param name="asset">Asset UUID to create</param> 156 /// <param name="asset">Asset UUID to create</param>
157 /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks> 157 /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
158 override public void StoreAsset(AssetBase asset) 158 override public bool StoreAsset(AssetBase asset)
159 { 159 {
160 lock (m_dbLock) 160 lock (m_dbLock)
161 { 161 {
@@ -203,12 +203,14 @@ namespace OpenSim.Data.MySQL
203 cmd.Parameters.AddWithValue("?data", asset.Data); 203 cmd.Parameters.AddWithValue("?data", asset.Data);
204 cmd.ExecuteNonQuery(); 204 cmd.ExecuteNonQuery();
205 cmd.Dispose(); 205 cmd.Dispose();
206 return true;
206 } 207 }
207 } 208 }
208 catch (Exception e) 209 catch (Exception e)
209 { 210 {
210 m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}", 211 m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
211 asset.FullID, asset.Name, e.Message); 212 asset.FullID, asset.Name, e.Message);
213 return false;
212 } 214 }
213 } 215 }
214 } 216 }
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
index aa69d68..92afa75 100644
--- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Data.MySQL
72 } 72 }
73 else 73 else
74 { 74 {
75 cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst or LastName like ?searchLast)", m_Realm); 75 cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst and LastName like ?searchLast)", m_Realm);
76 cmd.Parameters.AddWithValue("?searchFirst", "%" + words[0] + "%"); 76 cmd.Parameters.AddWithValue("?searchFirst", "%" + words[0] + "%");
77 cmd.Parameters.AddWithValue("?searchLast", "%" + words[1] + "%"); 77 cmd.Parameters.AddWithValue("?searchLast", "%" + words[1] + "%");
78 cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString()); 78 cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString());
@@ -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 ec54dba..241616b 100644
--- a/OpenSim/Data/Null/NullUserAccountData.cs
+++ b/OpenSim/Data/Null/NullUserAccountData.cs
@@ -193,5 +193,10 @@ namespace OpenSim.Data.Null
193 193
194 return false; 194 return false;
195 } 195 }
196
197 public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
198 {
199 return null;
200 }
196 } 201 }
197} 202}
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}