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)
This commit is contained in:
AlexRa
2010-05-18 14:28:12 +03:00
parent a27d49b188
commit 8a0c5d14d4
5 changed files with 68 additions and 92 deletions

View File

@@ -148,19 +148,16 @@ namespace OpenSim.Data.MySQL
foreach (string name in m_Fields.Keys)
{
if (m_Fields[name].GetValue(row) is bool)
if (m_Fields[name].FieldType == typeof(bool))
{
int v = Convert.ToInt32(reader[name]);
m_Fields[name].SetValue(row, v != 0 ? true : false);
}
else if (m_Fields[name].GetValue(row) is UUID)
else if (m_Fields[name].FieldType == typeof(UUID))
{
UUID uuid = UUID.Zero;
UUID.TryParse(reader[name].ToString(), out uuid);
m_Fields[name].SetValue(row, uuid);
m_Fields[name].SetValue(row, DBGuid.FromDB(reader[name]));
}
else if (m_Fields[name].GetValue(row) is int)
else if (m_Fields[name].FieldType == typeof(int))
{
int v = Convert.ToInt32(reader[name]);
m_Fields[name].SetValue(row, v);