diff options
author | BlueWall | 2011-06-01 17:01:40 -0400 |
---|---|---|
committer | BlueWall | 2011-06-01 17:01:40 -0400 |
commit | ac4d080aaff6058e0855ebc842577b479c47b72a (patch) | |
tree | 918dba006ce1dbcffa7600f1546414c1b201def3 /OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs | |
parent | Merge branch 'master' of /home/opensim/src/opensim (diff) | |
parent | Adding boolean alias for commandline switches like -save_crashes=yes (diff) | |
download | opensim-SC_OLD-ac4d080aaff6058e0855ebc842577b479c47b72a.zip opensim-SC_OLD-ac4d080aaff6058e0855ebc842577b479c47b72a.tar.gz opensim-SC_OLD-ac4d080aaff6058e0855ebc842577b479c47b72a.tar.bz2 opensim-SC_OLD-ac4d080aaff6058e0855ebc842577b479c47b72a.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs b/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs index ab9df4c..4145d95 100644 --- a/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs +++ b/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs | |||
@@ -168,14 +168,13 @@ namespace OpenSim.Data.MSSQL | |||
168 | 168 | ||
169 | protected T[] DoQuery(SqlCommand cmd) | 169 | protected T[] DoQuery(SqlCommand cmd) |
170 | { | 170 | { |
171 | List<T> result = new List<T>(); | ||
171 | using (SqlDataReader reader = cmd.ExecuteReader()) | 172 | using (SqlDataReader reader = cmd.ExecuteReader()) |
172 | { | 173 | { |
173 | if (reader == null) | 174 | if (reader == null) |
174 | return new T[0]; | 175 | return new T[0]; |
175 | 176 | ||
176 | CheckColumnNames(reader); | 177 | CheckColumnNames(reader); |
177 | |||
178 | List<T> result = new List<T>(); | ||
179 | 178 | ||
180 | while (reader.Read()) | 179 | while (reader.Read()) |
181 | { | 180 | { |
@@ -262,6 +261,15 @@ namespace OpenSim.Data.MSSQL | |||
262 | { | 261 | { |
263 | names.Add(fi.Name); | 262 | names.Add(fi.Name); |
264 | values.Add("@" + fi.Name); | 263 | values.Add("@" + fi.Name); |
264 | // Temporarily return more information about what field is unexpectedly null for | ||
265 | // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the | ||
266 | // InventoryTransferModule or we may be required to substitute a DBNull here. | ||
267 | if (fi.GetValue(row) == null) | ||
268 | throw new NullReferenceException( | ||
269 | string.Format( | ||
270 | "[MSSQL GENERIC TABLE HANDLER]: Trying to store field {0} for {1} which is unexpectedly null", | ||
271 | fi.Name, row)); | ||
272 | |||
265 | if (constraintFields.Count > 0 && constraintFields.Contains(fi.Name)) | 273 | if (constraintFields.Count > 0 && constraintFields.Contains(fi.Name)) |
266 | { | 274 | { |
267 | constraints.Add(new KeyValuePair<string, string>(fi.Name, fi.GetValue(row).ToString())); | 275 | constraints.Add(new KeyValuePair<string, string>(fi.Name, fi.GetValue(row).ToString())); |
@@ -363,7 +371,13 @@ namespace OpenSim.Data.MSSQL | |||
363 | cmd.Connection = conn; | 371 | cmd.Connection = conn; |
364 | cmd.CommandText = query; | 372 | cmd.CommandText = query; |
365 | conn.Open(); | 373 | conn.Open(); |
366 | return cmd.ExecuteNonQuery() > 0; | 374 | |
375 | if (cmd.ExecuteNonQuery() > 0) | ||
376 | { | ||
377 | //m_log.Warn("[MSSQLGenericTable]: " + deleteCommand); | ||
378 | return true; | ||
379 | } | ||
380 | return false; | ||
367 | } | 381 | } |
368 | } | 382 | } |
369 | } | 383 | } |