diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | 15 | ||||
-rwxr-xr-x | OpenSim/Data/Null/NullEstateData.cs | 6 |
2 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs index 8efe4e9..50b6dbe 100644 --- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs +++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | |||
@@ -39,6 +39,8 @@ namespace OpenSim.Data.MySQL | |||
39 | { | 39 | { |
40 | public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new() | 40 | public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new() |
41 | { | 41 | { |
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | |||
42 | protected Dictionary<string, FieldInfo> m_Fields = | 44 | protected Dictionary<string, FieldInfo> m_Fields = |
43 | new Dictionary<string, FieldInfo>(); | 45 | new Dictionary<string, FieldInfo>(); |
44 | 46 | ||
@@ -217,7 +219,6 @@ namespace OpenSim.Data.MySQL | |||
217 | { | 219 | { |
218 | using (MySqlCommand cmd = new MySqlCommand()) | 220 | using (MySqlCommand cmd = new MySqlCommand()) |
219 | { | 221 | { |
220 | |||
221 | string query = ""; | 222 | string query = ""; |
222 | List<String> names = new List<String>(); | 223 | List<String> names = new List<String>(); |
223 | List<String> values = new List<String>(); | 224 | List<String> values = new List<String>(); |
@@ -226,6 +227,16 @@ namespace OpenSim.Data.MySQL | |||
226 | { | 227 | { |
227 | names.Add(fi.Name); | 228 | names.Add(fi.Name); |
228 | values.Add("?" + fi.Name); | 229 | values.Add("?" + fi.Name); |
230 | |||
231 | // Temporarily return more information about what field is unexpectedly null for | ||
232 | // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the | ||
233 | // InventoryTransferModule or we may be required to substitute a DBNull here. | ||
234 | if (fi.GetValue(row) == null) | ||
235 | throw new NullReferenceException( | ||
236 | string.Format( | ||
237 | "[MYSQL GENERIC TABLE HANDLER]: Trying to store field {0} for {1} which is unexpectedly null", | ||
238 | fi.Name, row)); | ||
239 | |||
229 | cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString()); | 240 | cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString()); |
230 | } | 241 | } |
231 | 242 | ||
@@ -268,4 +279,4 @@ namespace OpenSim.Data.MySQL | |||
268 | } | 279 | } |
269 | } | 280 | } |
270 | } | 281 | } |
271 | } | 282 | } \ No newline at end of file |
diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs index 0cebff5..8db8064 100755 --- a/OpenSim/Data/Null/NullEstateData.cs +++ b/OpenSim/Data/Null/NullEstateData.cs | |||
@@ -38,9 +38,9 @@ namespace OpenSim.Data.Null | |||
38 | { | 38 | { |
39 | public class NullEstateStore : IEstateDataStore | 39 | public class NullEstateStore : IEstateDataStore |
40 | { | 40 | { |
41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 41 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
42 | 42 | ||
43 | private string m_connectionString; | 43 | // private string m_connectionString; |
44 | 44 | ||
45 | protected virtual Assembly Assembly | 45 | protected virtual Assembly Assembly |
46 | { | 46 | { |
@@ -58,7 +58,7 @@ namespace OpenSim.Data.Null | |||
58 | 58 | ||
59 | public void Initialise(string connectionString) | 59 | public void Initialise(string connectionString) |
60 | { | 60 | { |
61 | m_connectionString = connectionString; | 61 | // m_connectionString = connectionString; |
62 | } | 62 | } |
63 | 63 | ||
64 | private string[] FieldList | 64 | private string[] FieldList |