mirror of
https://github.com/opensim/opensim.git
synced 2026-06-12 07:15:34 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user