aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
diff options
context:
space:
mode:
authorAlexRa2010-05-18 14:28:12 +0300
committerAlexRa2010-05-19 01:33:02 +0300
commit8a0c5d14d45571c3e7529fdacea6f0483af482e5 (patch)
tree30b580dbda83e3b8e3966fa7d538d5aee8102a63 /OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
parentAdded DBGuids.cs (static func DBGuid.FromDB() (diff)
downloadopensim-SC_OLD-8a0c5d14d45571c3e7529fdacea6f0483af482e5.zip
opensim-SC_OLD-8a0c5d14d45571c3e7529fdacea6f0483af482e5.tar.gz
opensim-SC_OLD-8a0c5d14d45571c3e7529fdacea6f0483af482e5.tar.bz2
opensim-SC_OLD-8a0c5d14d45571c3e7529fdacea6f0483af482e5.tar.xz
All (?) MySQL stores fixed to use DBGuid.FromDB()
This was needed if we want to update to the latest MySQL connector dll. It automatically converts CHAR(36) to Guids, so getting them as strings no longer works. By using DBGuid.FromDB(), we unlink from any particular storage format of GUIDs, could even make them BINARY(16) if we like. Actually not all MySql units are touched, but the remaining ones don't seem to be affected (they don't read GUIDs from DB)
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLGenericTableHandler.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLGenericTableHandler.cs11
1 files changed, 4 insertions, 7 deletions
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
index 1253e0b..6cbb2ee 100644
--- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -148,19 +148,16 @@ namespace OpenSim.Data.MySQL
148 148
149 foreach (string name in m_Fields.Keys) 149 foreach (string name in m_Fields.Keys)
150 { 150 {
151 if (m_Fields[name].GetValue(row) is bool) 151 if (m_Fields[name].FieldType == typeof(bool))
152 { 152 {
153 int v = Convert.ToInt32(reader[name]); 153 int v = Convert.ToInt32(reader[name]);
154 m_Fields[name].SetValue(row, v != 0 ? true : false); 154 m_Fields[name].SetValue(row, v != 0 ? true : false);
155 } 155 }
156 else if (m_Fields[name].GetValue(row) is UUID) 156 else if (m_Fields[name].FieldType == typeof(UUID))
157 { 157 {
158 UUID uuid = UUID.Zero; 158 m_Fields[name].SetValue(row, DBGuid.FromDB(reader[name]));
159
160 UUID.TryParse(reader[name].ToString(), out uuid);
161 m_Fields[name].SetValue(row, uuid);
162 } 159 }
163 else if (m_Fields[name].GetValue(row) is int) 160 else if (m_Fields[name].FieldType == typeof(int))
164 { 161 {
165 int v = Convert.ToInt32(reader[name]); 162 int v = Convert.ToInt32(reader[name]);
166 m_Fields[name].SetValue(row, v); 163 m_Fields[name].SetValue(row, v);