aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorUbitUmarov2016-11-09 22:39:52 +0000
committerUbitUmarov2016-11-09 22:39:52 +0000
commitd1baa3e0c3b1783a68061980ffd8b9693c5a474a (patch)
tree774fb5ae0be5e9b597c46af3b3b5f3e0c6a3f0d6 /OpenSim/Data
parentstop warning about integer division cast to float (diff)
downloadopensim-SC-d1baa3e0c3b1783a68061980ffd8b9693c5a474a.zip
opensim-SC-d1baa3e0c3b1783a68061980ffd8b9693c5a474a.tar.gz
opensim-SC-d1baa3e0c3b1783a68061980ffd8b9693c5a474a.tar.bz2
opensim-SC-d1baa3e0c3b1783a68061980ffd8b9693c5a474a.tar.xz
fix some invalid string.format arguments
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/MySQL/MySQLXInventoryData.cs9
-rw-r--r--OpenSim/Data/PGSQL/PGSQLXInventoryData.cs11
2 files changed, 17 insertions, 3 deletions
diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
index c74033e..9a0044e 100644
--- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
@@ -193,7 +193,9 @@ namespace OpenSim.Data.MySQL
193 { 193 {
194 using (MySqlCommand cmd = new MySqlCommand()) 194 using (MySqlCommand cmd = new MySqlCommand())
195 { 195 {
196 cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags & 1", m_Realm); 196// cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags & 1", m_Realm);
197
198 cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags & 1");
197 199
198 cmd.Parameters.AddWithValue("?uuid", principalID.ToString()); 200 cmd.Parameters.AddWithValue("?uuid", principalID.ToString());
199 cmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture); 201 cmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture);
@@ -212,7 +214,10 @@ namespace OpenSim.Data.MySQL
212 { 214 {
213 cmd.Connection = dbcon; 215 cmd.Connection = dbcon;
214 216
215 cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = ?PrincipalID and assetID = ?AssetID group by assetID", m_Realm); 217// cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = ?PrincipalID and assetID = ?AssetID group by assetID", m_Realm);
218
219 cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = ?PrincipalID and assetID = ?AssetID group by assetID");
220
216 cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); 221 cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
217 cmd.Parameters.AddWithValue("?AssetID", assetID.ToString()); 222 cmd.Parameters.AddWithValue("?AssetID", assetID.ToString());
218 223
diff --git a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs
index a22b882..c34a8dc 100644
--- a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs
@@ -174,7 +174,9 @@ namespace OpenSim.Data.PGSQL
174 { 174 {
175 using (NpgsqlCommand cmd = new NpgsqlCommand()) 175 using (NpgsqlCommand cmd = new NpgsqlCommand())
176 { 176 {
177 cmd.CommandText = String.Format(@"select * from inventoryitems where ""avatarID"" = :uuid and ""assetType"" = :type and ""flags"" = 1", m_Realm); 177// cmd.CommandText = String.Format(@"select * from inventoryitems where ""avatarID"" = :uuid and ""assetType"" = :type and ""flags"" = 1", m_Realm);
178
179 cmd.CommandText = String.Format(@"select * from inventoryitems where ""avatarID"" = :uuid and ""assetType"" = :type and ""flags"" = 1");
178 180
179 UUID princID = UUID.Zero; 181 UUID princID = UUID.Zero;
180 UUID.TryParse(principalID, out princID); 182 UUID.TryParse(principalID, out princID);
@@ -194,11 +196,18 @@ namespace OpenSim.Data.PGSQL
194 { 196 {
195 using (NpgsqlCommand cmd = new NpgsqlCommand()) 197 using (NpgsqlCommand cmd = new NpgsqlCommand())
196 { 198 {
199/*
197 cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" 200 cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions""
198 from inventoryitems 201 from inventoryitems
199 where ""avatarID"" = :PrincipalID 202 where ""avatarID"" = :PrincipalID
200 and ""assetID"" = :AssetID 203 and ""assetID"" = :AssetID
201 group by ""assetID"" ", m_Realm); 204 group by ""assetID"" ", m_Realm);
205*/
206 cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions""
207 from inventoryitems
208 where ""avatarID"" = :PrincipalID
209 and ""assetID"" = :AssetID
210 group by ""assetID"" ");
202 211
203 cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID)); 212 cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID));
204 cmd.Parameters.Add(m_database.CreateParameter("AssetID", assetID)); 213 cmd.Parameters.Add(m_database.CreateParameter("AssetID", assetID));