diff options
author | Oren Hurvitz | 2012-04-23 18:39:23 +0300 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-24 20:49:28 +0100 |
commit | da5fd53702ce97d13da2cb50da0753d507e6c11b (patch) | |
tree | 1c9552953ddea3d1fc97d8673cfe362367d0db08 /OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | |
parent | When reading a region, use null objects to represent NULL fields. (diff) | |
download | opensim-SC_OLD-da5fd53702ce97d13da2cb50da0753d507e6c11b.zip opensim-SC_OLD-da5fd53702ce97d13da2cb50da0753d507e6c11b.tar.gz opensim-SC_OLD-da5fd53702ce97d13da2cb50da0753d507e6c11b.tar.bz2 opensim-SC_OLD-da5fd53702ce97d13da2cb50da0753d507e6c11b.tar.xz |
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.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs index 754cf72..da8e958 100644 --- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs +++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | |||
@@ -91,15 +91,17 @@ namespace OpenSim.Data.MySQL | |||
91 | if (m_ColumnNames != null) | 91 | if (m_ColumnNames != null) |
92 | return; | 92 | return; |
93 | 93 | ||
94 | m_ColumnNames = new List<string>(); | 94 | List<string> columnNames = new List<string>(); |
95 | 95 | ||
96 | DataTable schemaTable = reader.GetSchemaTable(); | 96 | DataTable schemaTable = reader.GetSchemaTable(); |
97 | foreach (DataRow row in schemaTable.Rows) | 97 | foreach (DataRow row in schemaTable.Rows) |
98 | { | 98 | { |
99 | if (row["ColumnName"] != null && | 99 | if (row["ColumnName"] != null && |
100 | (!m_Fields.ContainsKey(row["ColumnName"].ToString()))) | 100 | (!m_Fields.ContainsKey(row["ColumnName"].ToString()))) |
101 | m_ColumnNames.Add(row["ColumnName"].ToString()); | 101 | columnNames.Add(row["ColumnName"].ToString()); |
102 | } | 102 | } |
103 | |||
104 | m_ColumnNames = columnNames; | ||
103 | } | 105 | } |
104 | 106 | ||
105 | public virtual T[] Get(string field, string key) | 107 | public virtual T[] Get(string field, string key) |