diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLRegionData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 948cdf3..d1f1932 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -162,17 +162,7 @@ namespace OpenSim.Data.MySQL | |||
162 | ret.sizeX = Convert.ToInt32(result["sizeX"]); | 162 | ret.sizeX = Convert.ToInt32(result["sizeX"]); |
163 | ret.sizeY = Convert.ToInt32(result["sizeY"]); | 163 | ret.sizeY = Convert.ToInt32(result["sizeY"]); |
164 | 164 | ||
165 | if (m_ColumnNames == null) | 165 | CheckColumnNames(result); |
166 | { | ||
167 | m_ColumnNames = new List<string>(); | ||
168 | |||
169 | DataTable schemaTable = result.GetSchemaTable(); | ||
170 | foreach (DataRow row in schemaTable.Rows) | ||
171 | { | ||
172 | if (row["ColumnName"] != null) | ||
173 | m_ColumnNames.Add(row["ColumnName"].ToString()); | ||
174 | } | ||
175 | } | ||
176 | 166 | ||
177 | foreach (string s in m_ColumnNames) | 167 | foreach (string s in m_ColumnNames) |
178 | { | 168 | { |
@@ -202,6 +192,23 @@ namespace OpenSim.Data.MySQL | |||
202 | return retList; | 192 | return retList; |
203 | } | 193 | } |
204 | 194 | ||
195 | private void CheckColumnNames(IDataReader result) | ||
196 | { | ||
197 | if (m_ColumnNames != null) | ||
198 | return; | ||
199 | |||
200 | List<string> columnNames = new List<string>(); | ||
201 | |||
202 | DataTable schemaTable = result.GetSchemaTable(); | ||
203 | foreach (DataRow row in schemaTable.Rows) | ||
204 | { | ||
205 | if (row["ColumnName"] != null) | ||
206 | columnNames.Add(row["ColumnName"].ToString()); | ||
207 | } | ||
208 | |||
209 | m_ColumnNames = columnNames; | ||
210 | } | ||
211 | |||
205 | public bool Store(RegionData data) | 212 | public bool Store(RegionData data) |
206 | { | 213 | { |
207 | if (data.Data.ContainsKey("uuid")) | 214 | if (data.Data.ContainsKey("uuid")) |