aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
diff options
context:
space:
mode:
authorChris Hart2011-09-13 16:55:30 -0400
committerJustin Clark-Casey (justincc)2011-09-16 19:09:46 +0100
commitd4043c084a86da5f462356ec5c65eab2b861564d (patch)
tree115685d90fd7c12ce5d7191f0106008bd2f9a1c3 /OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
parentReattaching a region was failing if the estate name had not changed (issue 50... (diff)
downloadopensim-SC-d4043c084a86da5f462356ec5c65eab2b861564d.zip
opensim-SC-d4043c084a86da5f462356ec5c65eab2b861564d.tar.gz
opensim-SC-d4043c084a86da5f462356ec5c65eab2b861564d.tar.bz2
opensim-SC-d4043c084a86da5f462356ec5c65eab2b861564d.tar.xz
MSSQL Bug fix in user account retrieval, plus migrations for FriendsStore and InventoryStore
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLUserAccountData.cs')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLUserAccountData.cs18
1 files changed, 11 insertions, 7 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
index e7c8dc5..7feec91 100644
--- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
@@ -218,23 +218,27 @@ namespace OpenSim.Data.MSSQL
218 if (words.Length > 2) 218 if (words.Length > 2)
219 return new UserAccountData[0]; 219 return new UserAccountData[0];
220 220
221 string sql = "";
222
221 using (SqlConnection conn = new SqlConnection(m_ConnectionString)) 223 using (SqlConnection conn = new SqlConnection(m_ConnectionString))
222 using (SqlCommand cmd = new SqlCommand()) 224 using (SqlCommand cmd = new SqlCommand())
223 { 225 {
224 if (words.Length == 1) 226 if (words.Length == 1)
225 { 227 {
226 cmd.CommandText = String.Format("select * from {0} where ([ScopeID]=@ScopeID or [ScopeID]='00000000-0000-0000-0000-000000000000') and ([FirstName] like @search or [LastName] like @search)", m_Realm); 228 sql = String.Format("select * from {0} where ([ScopeID]=@ScopeID or [ScopeID]='00000000-0000-0000-0000-000000000000') and ([FirstName] like @search or [LastName] like @search)", m_Realm);
227 cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); 229 cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID));
228 cmd.Parameters.Add(m_database.CreateParameter("@search", "%" + words[0] + "%")); 230 cmd.Parameters.Add(m_database.CreateParameter("@search", "%" + words[0] + "%"));
229 } 231 }
230 else 232 else
231 { 233 {
232 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); 234 sql = 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);
233 cmd.Parameters.Add(m_database.CreateParameter("@searchFirst", "%" + words[0] + "%")); 235 cmd.Parameters.Add(m_database.CreateParameter("@searchFirst", "%" + words[0] + "%"));
234 cmd.Parameters.Add(m_database.CreateParameter("@searchLast", "%" + words[1] + "%")); 236 cmd.Parameters.Add(m_database.CreateParameter("@searchLast", "%" + words[1] + "%"));
235 cmd.Parameters.Add(m_database.CreateParameter("@ScopeID", scopeID.ToString())); 237 cmd.Parameters.Add(m_database.CreateParameter("@ScopeID", scopeID.ToString()));
236 } 238 }
237 239 cmd.Connection = conn;
240 cmd.CommandText = sql;
241 conn.Open();
238 return DoQuery(cmd); 242 return DoQuery(cmd);
239 } 243 }
240 } 244 }