aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
diff options
context:
space:
mode:
authorDiva Canto2012-11-14 07:50:58 -0800
committerDiva Canto2012-11-14 07:50:58 -0800
commitfcaddd901c41647cf20321790a8f36fea9c8280b (patch)
treeacc1ab88d2b6b39b141168cb6d4679d84b32a2b6 /OpenSim/Data/SQLite/SQLiteUserAccountData.cs
parentPossibly fixes mantis #6429 (Flotsam cache having a null ref to the asset ser... (diff)
parentMore consistently dispose of SqliteCommand in OpenSim.Data.SQLite where possi... (diff)
downloadopensim-SC_OLD-fcaddd901c41647cf20321790a8f36fea9c8280b.zip
opensim-SC_OLD-fcaddd901c41647cf20321790a8f36fea9c8280b.tar.gz
opensim-SC_OLD-fcaddd901c41647cf20321790a8f36fea9c8280b.tar.bz2
opensim-SC_OLD-fcaddd901c41647cf20321790a8f36fea9c8280b.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserAccountData.cs25
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
index 7a5de50..f98d376 100644
--- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
@@ -66,20 +66,21 @@ namespace OpenSim.Data.SQLite
66 if (words.Length > 2) 66 if (words.Length > 2)
67 return new UserAccountData[0]; 67 return new UserAccountData[0];
68 68
69 SqliteCommand cmd = new SqliteCommand(); 69 using (SqliteCommand cmd = new SqliteCommand())
70
71 if (words.Length == 1)
72 {
73 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')",
74 m_Realm, scopeID.ToString(), words[0]);
75 }
76 else
77 { 70 {
78 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')", 71 if (words.Length == 1)
79 m_Realm, scopeID.ToString(), words[0], words[1]); 72 {
80 } 73 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')",
74 m_Realm, scopeID.ToString(), words[0]);
75 }
76 else
77 {
78 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')",
79 m_Realm, scopeID.ToString(), words[0], words[1]);
80 }
81 81
82 return DoQuery(cmd); 82 return DoQuery(cmd);
83 }
83 } 84 }
84 } 85 }
85} 86}