MySQLConnector is not a MS product

httptests
UbitUmarov 2017-05-06 01:25:54 +01:00
parent 8e30016841
commit d9038e650a
12 changed files with 110 additions and 14 deletions

View File

@ -75,6 +75,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "AssetStore");
m.Update();
dbcon.Close();
}
}
@ -144,6 +145,7 @@ namespace OpenSim.Data.MySQL
string.Format("[ASSETS DB]: MySql failure fetching asset {0}. Exception ", assetID), e);
}
}
dbcon.Close();
}
return asset;
@ -209,6 +211,7 @@ namespace OpenSim.Data.MySQL
return false;
}
}
dbcon.Close();
}
}
@ -238,6 +241,7 @@ namespace OpenSim.Data.MySQL
e);
}
}
dbcon.Close();
}
}
@ -270,6 +274,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
bool[] results = new bool[uuids.Length];
@ -334,6 +339,7 @@ namespace OpenSim.Data.MySQL
e);
}
}
dbcon.Close();
}
return retList;
@ -350,6 +356,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?id", id);
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
return true;

View File

@ -59,6 +59,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "AuthStore");
m.Update();
dbcon.Close();
}
}
@ -99,6 +100,7 @@ namespace OpenSim.Data.MySQL
return null;
}
}
dbcon.Close();
}
}

View File

@ -171,12 +171,13 @@ namespace OpenSim.Data.MySQL
}
}
}
if (!found && create)
{
DoCreate(es);
LinkRegion(regionID, (int)es.EstateID);
}
cmd.Connection = null;
dbcon.Close();
}
LoadBanList(es);
@ -231,6 +232,7 @@ namespace OpenSim.Data.MySQL
es.Save();
}
dbcon.Close();
}
}
@ -263,6 +265,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
SaveBanList(es);
@ -300,6 +303,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
@ -329,6 +333,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.Clear();
}
}
dbcon.Close();
}
}
@ -358,6 +363,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.Clear();
}
}
dbcon.Close();
}
}
@ -383,6 +389,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
return uuids.ToArray();
@ -437,7 +444,6 @@ namespace OpenSim.Data.MySQL
reader.Close();
}
}
dbcon.Close();
}
@ -466,7 +472,6 @@ namespace OpenSim.Data.MySQL
reader.Close();
}
}
dbcon.Close();
}

View File

@ -121,9 +121,13 @@ namespace OpenSim.Data.MySQL
}
catch (MySqlException e)
{
cmd.Connection = null;
conn.Close();
m_log.ErrorFormat("[FSASSETS]: Query {0} failed with {1}", cmd.CommandText, e.ToString());
return false;
}
cmd.Connection = null;
conn.Close();
}
return true;
@ -175,7 +179,7 @@ namespace OpenSim.Data.MySQL
UpdateAccessTime(id, AccessTime);
}
}
conn.Close();
}
return meta;
@ -206,6 +210,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?id", AssetID);
cmd.ExecuteNonQuery();
}
conn.Close();
}
}
@ -299,6 +304,7 @@ namespace OpenSim.Data.MySQL
}
}
}
conn.Close();
}
for (int i = 0; i < uuids.Length; i++)
@ -333,6 +339,7 @@ namespace OpenSim.Data.MySQL
count = Convert.ToInt32(reader["count"]);
}
}
conn.Close();
}
return count;
@ -413,8 +420,8 @@ namespace OpenSim.Data.MySQL
imported++;
}
}
}
importConn.Close();
}
MainConsole.Instance.Output(String.Format("Import done, {0} assets imported", imported));

View File

@ -74,7 +74,9 @@ namespace OpenSim.Data.MySQL
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
return ExecuteNonQueryWithConnection(cmd, dbcon);
int ret = ExecuteNonQueryWithConnection(cmd, dbcon);
dbcon.Close();
return ret;
}
}
else
@ -97,12 +99,15 @@ namespace OpenSim.Data.MySQL
try
{
return cmd.ExecuteNonQuery();
int ret = cmd.ExecuteNonQuery();
cmd.Connection = null;
return ret;
}
catch (Exception e)
{
m_log.Error(e.Message, e);
m_log.Error(Environment.StackTrace.ToString());
cmd.Connection = null;
return 0;
}
}

View File

@ -160,8 +160,9 @@ namespace OpenSim.Data.MySQL
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
return DoQueryWithConnection(cmd, dbcon);
T[] ret = DoQueryWithConnection(cmd, dbcon);
dbcon.Close();
return ret;
}
}
else
@ -243,7 +244,7 @@ namespace OpenSim.Data.MySQL
result.Add(row);
}
}
cmd.Connection = null;
return result.ToArray();
}
@ -402,7 +403,10 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
cmd.Connection = dbcon;
return cmd.ExecuteScalar();
Object ret = cmd.ExecuteScalar();
cmd.Connection = null;
dbcon.Close();
return ret;
}
}
else

View File

@ -78,6 +78,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, assem, "InventoryStore");
m.Update();
dbcon.Close();
}
}
@ -133,6 +134,7 @@ namespace OpenSim.Data.MySQL
return items;
}
}
dbcon.Close();
}
}
}
@ -173,6 +175,7 @@ namespace OpenSim.Data.MySQL
return items;
}
}
dbcon.Close();
}
}
}
@ -224,6 +227,7 @@ namespace OpenSim.Data.MySQL
return rootFolder;
}
}
dbcon.Close();
}
}
}
@ -264,6 +268,7 @@ namespace OpenSim.Data.MySQL
return items;
}
}
dbcon.Close();
}
}
}
@ -355,6 +360,7 @@ namespace OpenSim.Data.MySQL
return item;
}
}
dbcon.Close();
}
}
}
@ -420,6 +426,7 @@ namespace OpenSim.Data.MySQL
return folder;
}
}
dbcon.Close();
}
}
}
@ -497,6 +504,8 @@ namespace OpenSim.Data.MySQL
result.Dispose();
}
dbcon.Close();
using (MySqlCommand result = new MySqlCommand("update inventoryfolders set version=version+1 where folderID = ?folderID", dbcon))
{
result.Parameters.AddWithValue("?folderID", item.Folder.ToString());
@ -540,6 +549,7 @@ namespace OpenSim.Data.MySQL
lock (m_dbLock)
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (MySqlException e)
@ -600,6 +610,7 @@ namespace OpenSim.Data.MySQL
m_log.Error(e.ToString());
}
}
dbcon.Close();
}
}
@ -643,6 +654,7 @@ namespace OpenSim.Data.MySQL
m_log.Error(e.ToString());
}
}
dbcon.Close();
}
}
@ -806,6 +818,7 @@ namespace OpenSim.Data.MySQL
lock (m_dbLock)
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (MySqlException e)
@ -833,6 +846,7 @@ namespace OpenSim.Data.MySQL
lock (m_dbLock)
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (MySqlException e)
@ -889,6 +903,7 @@ namespace OpenSim.Data.MySQL
return list;
}
}
dbcon.Close();
}
}
catch (Exception e)

View File

@ -60,6 +60,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "GridStore");
m.Update();
dbcon.Close();
}
}
@ -260,6 +261,8 @@ namespace OpenSim.Data.MySQL
retList.Add(ret);
}
}
cmd.Connection = null;
dbcon.Close();
}
return retList;

View File

@ -88,6 +88,7 @@ namespace OpenSim.Data.MySQL
//
Migration m = new Migration(dbcon, Assembly, "RegionStore");
m.Update();
dbcon.Close();
}
}
@ -334,6 +335,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
dbcon.Close();
}
}
}
@ -372,6 +374,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
dbcon.Close();
}
}
}
@ -411,6 +414,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
dbcon.Close();
}
}
}
@ -460,6 +464,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
@ -535,6 +540,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
@ -580,6 +586,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
prim.Inventory.RestoreInventoryItems(inventory);
@ -634,6 +641,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
});
@ -681,6 +689,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
});
@ -727,6 +736,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
@ -762,6 +772,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
@ -783,6 +794,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
dbcon.Close();
}
}
}
@ -842,6 +854,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.Clear();
}
}
dbcon.Close();
}
}
}
@ -939,6 +952,7 @@ namespace OpenSim.Data.MySQL
nWP.valid = true;
}
}
dbcon.Close();
}
return nWP;
@ -976,6 +990,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
@ -1084,6 +1099,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
dbcon.Close();
}
}
@ -1099,6 +1115,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?regionID", regionID.ToString());
ExecuteNonQuery(cmd);
}
dbcon.Close();
}
}
@ -1127,6 +1144,7 @@ namespace OpenSim.Data.MySQL
return Convert.ToString(result["llsd_settings"]);
}
}
dbcon.Close();
}
}
@ -1145,6 +1163,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
dbcon.Close();
}
}
@ -1160,6 +1179,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
ExecuteNonQuery(cmd);
}
dbcon.Close();
}
}
#endregion
@ -1212,7 +1232,7 @@ namespace OpenSim.Data.MySQL
FillRegionSettingsCommand(cmd, rs);
ExecuteNonQuery(cmd);
}
dbcon.Close();
SaveSpawnPoints(rs);
}
}
@ -1259,6 +1279,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
@ -2123,6 +2144,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
}
dbcon.Close();
}
}
}
@ -2152,6 +2174,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
@ -2187,6 +2210,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
}
@ -2221,6 +2245,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.Clear();
}
}
dbcon.Close();
}
}
}
@ -2240,6 +2265,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
@ -2257,6 +2283,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
@ -2280,6 +2307,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
return ret;

View File

@ -69,6 +69,7 @@ namespace OpenSim.Data.MySQL
Migration m = new Migration(dbcon, Assembly, "UserProfiles");
m.Update();
dbcon.Close();
}
}
#endregion Member Functions
@ -121,6 +122,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
return data;
}
@ -228,6 +230,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (Exception e)
@ -258,6 +261,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?recordId", recordId.ToString());
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (Exception e)
@ -352,6 +356,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
catch (Exception e)
@ -474,6 +479,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (Exception e)
@ -504,6 +510,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (Exception e)
@ -548,6 +555,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
catch (Exception e)
@ -596,6 +604,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (Exception e)
@ -719,6 +728,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
catch (Exception e)
@ -759,6 +769,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (Exception e)
@ -884,6 +895,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
catch (Exception e)
@ -939,6 +951,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
catch (Exception e)
@ -975,6 +988,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (Exception e)
@ -1035,6 +1049,7 @@ namespace OpenSim.Data.MySQL
}
}
}
dbcon.Close();
}
}
catch (Exception e)
@ -1072,6 +1087,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
dbcon.Close();
}
}
catch (Exception e)

View File

@ -97,6 +97,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "XAssetStore");
m.Update();
dbcon.Close();
}
}
@ -184,6 +185,7 @@ namespace OpenSim.Data.MySQL
m_log.Error(string.Format("[MYSQL XASSET DATA]: Failure fetching asset {0}", assetID), e);
}
}
dbcon.Close();
}
return asset;
@ -303,6 +305,7 @@ namespace OpenSim.Data.MySQL
transaction.Commit();
}
dbcon.Close();
}
}
@ -344,6 +347,7 @@ namespace OpenSim.Data.MySQL
"[XASSET MYSQL DB]: Failure updating access_time for asset {0} with name {1}",
assetMetadata.ID, assetMetadata.Name);
}
dbcon.Close();
}
}
@ -474,6 +478,7 @@ namespace OpenSim.Data.MySQL
m_log.Error("[XASSETS DB]: MySql failure fetching asset set" + Environment.NewLine + e.ToString());
}
}
dbcon.Close();
}
return retList;
@ -492,9 +497,9 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?ID", id);
cmd.ExecuteNonQuery();
}
// TODO: How do we deal with data from deleted assets? Probably not easily reapable unless we
// keep a reference count (?)
dbcon.Close();
}
return true;

View File

@ -328,7 +328,6 @@ namespace OpenSim.Data.MySQL
{
return false;
}
cmd.Dispose();
}
dbcon.Close();