* Add more class cast exceptions to mysql read inventory item to cover all new fields - not just those I think are initially failing.

* This is more likely to allow existing mysql databases to work temporarily, if the previous revision doesn't work
0.6.0-stable
Justin Clarke Casey 2008-05-01 13:41:36 +00:00
parent d72bdf432a
commit 13e51b197c
1 changed files with 26 additions and 3 deletions

View File

@ -343,7 +343,14 @@ namespace OpenSim.Data.MySQL
m_log.WarnFormat("Could not cast salePrice {0} to {1}", reader["salePrice"], "int");
}
item.SaleType = Convert.ToByte(reader["saleType"]);
try
{
item.SaleType = Convert.ToByte(reader["saleType"]);
}
catch (InvalidCastException)
{
m_log.WarnFormat("Could not convert saleType {0} to {1}", reader["saleType"], "byte");
}
try
{
@ -354,8 +361,24 @@ namespace OpenSim.Data.MySQL
m_log.WarnFormat("Could not cast creationDate {0} to {1}", reader["creationDate"], "int");
}
item.GroupID = new LLUUID(reader["groupID"].ToString());
item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
try
{
item.GroupID = new LLUUID(reader["groupID"].ToString());
}
catch (Exception)
{
item.GroupID = LLUUID.Zero;
m_log.WarnFormat("Could not convert groupID {0} to {1}", reader["groupID"], "LLUUID");
}
try
{
item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
}
catch (InvalidCastException)
{
m_log.WarnFormat("Could not cast groupOwned {0} to {1}", reader["groupOwned"], "boolean");
}
try
{