mirror of
https://github.com/opensim/opensim.git
synced 2026-06-11 06:35:48 +08:00
Fixed problem with MySQL: it was possible for one thread to use an incomplete list of column names if another thread was creating the list at the same time. Now this is thread-safe.
This commit is contained in:
committed by
Justin Clark-Casey (justincc)
parent
c70e85a327
commit
da5fd53702
@@ -79,14 +79,7 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
ret.PrincipalID = principalID;
|
||||
|
||||
if (m_ColumnNames == null)
|
||||
{
|
||||
m_ColumnNames = new List<string>();
|
||||
|
||||
DataTable schemaTable = result.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
m_ColumnNames.Add(row["ColumnName"].ToString());
|
||||
}
|
||||
CheckColumnNames(result);
|
||||
|
||||
foreach (string s in m_ColumnNames)
|
||||
{
|
||||
@@ -105,6 +98,20 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckColumnNames(IDataReader result)
|
||||
{
|
||||
if (m_ColumnNames != null)
|
||||
return;
|
||||
|
||||
List<string> columnNames = new List<string>();
|
||||
|
||||
DataTable schemaTable = result.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
columnNames.Add(row["ColumnName"].ToString());
|
||||
|
||||
m_ColumnNames = columnNames;
|
||||
}
|
||||
|
||||
public bool Store(AuthenticationData data)
|
||||
{
|
||||
if (data.Data.ContainsKey("UUID"))
|
||||
|
||||
Reference in New Issue
Block a user