diff options
author | BlueWall | 2014-10-16 17:53:45 -0400 |
---|---|---|
committer | BlueWall | 2014-10-16 21:16:44 -0400 |
commit | 94250b6836ab76376b6db8848f8f7db63a519847 (patch) | |
tree | 99374dec44fee9e0aef9cca51c2ea50366dd8a33 /OpenSim/Data | |
parent | Add some more llGiveInventory() regression tests (diff) | |
download | opensim-SC_OLD-94250b6836ab76376b6db8848f8f7db63a519847.zip opensim-SC_OLD-94250b6836ab76376b6db8848f8f7db63a519847.tar.gz opensim-SC_OLD-94250b6836ab76376b6db8848f8f7db63a519847.tar.bz2 opensim-SC_OLD-94250b6836ab76376b6db8848f8f7db63a519847.tar.xz |
Fix some typecasting in PgSQL Groups adapter
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLUserAccountData.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs b/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs index 00f01cb..0a68b23 100644 --- a/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs +++ b/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs | |||
@@ -298,22 +298,26 @@ namespace OpenSim.Data.PGSQL | |||
298 | return new UserAccountData[0]; | 298 | return new UserAccountData[0]; |
299 | 299 | ||
300 | string sql = ""; | 300 | string sql = ""; |
301 | UUID scope_id; | ||
302 | UUID.TryParse(scopeID.ToString(), out scope_id); | ||
301 | 303 | ||
302 | using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) | 304 | using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) |
303 | using (NpgsqlCommand cmd = new NpgsqlCommand()) | 305 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
304 | { | 306 | { |
305 | if (words.Length == 1) | 307 | if (words.Length == 1) |
306 | { | 308 | { |
307 | sql = String.Format(@"select * from {0} where (""ScopeID""=:ScopeID or ""ScopeID""='00000000-0000-0000-0000-000000000000') and (""FirstName"" ilike :search or ""LastName"" ilike :search)", m_Realm); | 309 | sql = String.Format(@"select * from {0} where (""ScopeID""=:ScopeID or ""ScopeID""=:UUIDZero) and (""FirstName"" ilike :search or ""LastName"" ilike :search)", m_Realm); |
308 | cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); | 310 | cmd.Parameters.Add(m_database.CreateParameter("scopeID", (UUID)scope_id)); |
311 | cmd.Parameters.Add (m_database.CreateParameter("UUIDZero", (UUID)UUID.Zero)); | ||
309 | cmd.Parameters.Add(m_database.CreateParameter("search", "%" + words[0] + "%")); | 312 | cmd.Parameters.Add(m_database.CreateParameter("search", "%" + words[0] + "%")); |
310 | } | 313 | } |
311 | else | 314 | else |
312 | { | 315 | { |
313 | sql = String.Format(@"select * from {0} where (""ScopeID""=:ScopeID or ""ScopeID""='00000000-0000-0000-0000-000000000000') and (""FirstName"" ilike :searchFirst or ""LastName"" ilike :searchLast)", m_Realm); | 316 | sql = String.Format(@"select * from {0} where (""ScopeID""=:ScopeID or ""ScopeID""=:UUIDZero) and (""FirstName"" ilike :searchFirst or ""LastName"" ilike :searchLast)", m_Realm); |
314 | cmd.Parameters.Add(m_database.CreateParameter("searchFirst", "%" + words[0] + "%")); | 317 | cmd.Parameters.Add(m_database.CreateParameter("searchFirst", "%" + words[0] + "%")); |
315 | cmd.Parameters.Add(m_database.CreateParameter("searchLast", "%" + words[1] + "%")); | 318 | cmd.Parameters.Add(m_database.CreateParameter("searchLast", "%" + words[1] + "%")); |
316 | cmd.Parameters.Add(m_database.CreateParameter("ScopeID", scopeID.ToString())); | 319 | cmd.Parameters.Add (m_database.CreateParameter("UUIDZero", (UUID)UUID.Zero)); |
320 | cmd.Parameters.Add(m_database.CreateParameter("ScopeID", (UUID)scope_id)); | ||
317 | } | 321 | } |
318 | cmd.Connection = conn; | 322 | cmd.Connection = conn; |
319 | cmd.CommandText = sql; | 323 | cmd.CommandText = sql; |