mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
* Changes varchar(36) columns to UUID type in MSSQL - this will be much more efficient * ===As always, please, please backup your database before applying this patch=== * Thanks Ruud Lathrop (for the patch) and StrawberryFride (for the review)
This commit is contained in:
@@ -102,6 +102,7 @@ namespace OpenSim.Data.MSSQL
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
/*
|
||||
[Obsolete("Do not use!")]
|
||||
protected static string defineTable(DataTable dt)
|
||||
{
|
||||
@@ -125,6 +126,7 @@ namespace OpenSim.Data.MSSQL
|
||||
sql += ")";
|
||||
return sql;
|
||||
}
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -134,6 +136,7 @@ namespace OpenSim.Data.MSSQL
|
||||
/// <param name="type">a type</param>
|
||||
/// <returns>a sqltype</returns>
|
||||
/// <remarks>this is something we'll need to implement for each db slightly differently.</remarks>
|
||||
/*
|
||||
[Obsolete("Used by a obsolete methods")]
|
||||
public static string SqlType(Type type)
|
||||
{
|
||||
@@ -155,6 +158,7 @@ namespace OpenSim.Data.MSSQL
|
||||
}
|
||||
return "varchar(255)";
|
||||
}
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Type conversion to a SQLDbType functions
|
||||
@@ -185,7 +189,7 @@ namespace OpenSim.Data.MSSQL
|
||||
}
|
||||
if (type == typeof(UUID))
|
||||
{
|
||||
return SqlDbType.VarChar;
|
||||
return SqlDbType.UniqueIdentifier;
|
||||
}
|
||||
if (type == typeof(sbyte))
|
||||
{
|
||||
@@ -215,13 +219,13 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
Type valueType = value.GetType();
|
||||
|
||||
if (valueType == typeof(UUID))
|
||||
if (valueType == typeof(UUID)) //TODO check if this works
|
||||
{
|
||||
return value.ToString();
|
||||
return ((UUID) value).Guid;
|
||||
}
|
||||
if (valueType == typeof(UUID))
|
||||
{
|
||||
return value.ToString();
|
||||
return ((UUID)value).Guid;
|
||||
}
|
||||
if (valueType == typeof(bool))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user