diff options
author | Justin Clarke Casey | 2009-02-19 18:09:10 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-19 18:09:10 +0000 |
commit | 07609565617aa7936758acba5fd625877564a10d (patch) | |
tree | 73123e37f14fea5f171cbe04753c21758f25afc1 /OpenSim/Data/MSSQL/MSSQLManager.cs | |
parent | * Okay, so finally got my head around this. Problem is that upstream Prebuild... (diff) | |
download | opensim-SC_OLD-07609565617aa7936758acba5fd625877564a10d.zip opensim-SC_OLD-07609565617aa7936758acba5fd625877564a10d.tar.gz opensim-SC_OLD-07609565617aa7936758acba5fd625877564a10d.tar.bz2 opensim-SC_OLD-07609565617aa7936758acba5fd625877564a10d.tar.xz |
* Apply http://opensimulator.org/mantis/view.php?id=3142
* 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)
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLManager.cs')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLManager.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index c687c89..d60c444 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs | |||
@@ -102,6 +102,7 @@ namespace OpenSim.Data.MSSQL | |||
102 | /// </summary> | 102 | /// </summary> |
103 | /// <param name="dt"></param> | 103 | /// <param name="dt"></param> |
104 | /// <returns></returns> | 104 | /// <returns></returns> |
105 | /* | ||
105 | [Obsolete("Do not use!")] | 106 | [Obsolete("Do not use!")] |
106 | protected static string defineTable(DataTable dt) | 107 | protected static string defineTable(DataTable dt) |
107 | { | 108 | { |
@@ -125,6 +126,7 @@ namespace OpenSim.Data.MSSQL | |||
125 | sql += ")"; | 126 | sql += ")"; |
126 | return sql; | 127 | return sql; |
127 | } | 128 | } |
129 | */ | ||
128 | 130 | ||
129 | #endregion | 131 | #endregion |
130 | 132 | ||
@@ -134,6 +136,7 @@ namespace OpenSim.Data.MSSQL | |||
134 | /// <param name="type">a type</param> | 136 | /// <param name="type">a type</param> |
135 | /// <returns>a sqltype</returns> | 137 | /// <returns>a sqltype</returns> |
136 | /// <remarks>this is something we'll need to implement for each db slightly differently.</remarks> | 138 | /// <remarks>this is something we'll need to implement for each db slightly differently.</remarks> |
139 | /* | ||
137 | [Obsolete("Used by a obsolete methods")] | 140 | [Obsolete("Used by a obsolete methods")] |
138 | public static string SqlType(Type type) | 141 | public static string SqlType(Type type) |
139 | { | 142 | { |
@@ -155,6 +158,7 @@ namespace OpenSim.Data.MSSQL | |||
155 | } | 158 | } |
156 | return "varchar(255)"; | 159 | return "varchar(255)"; |
157 | } | 160 | } |
161 | */ | ||
158 | 162 | ||
159 | /// <summary> | 163 | /// <summary> |
160 | /// Type conversion to a SQLDbType functions | 164 | /// Type conversion to a SQLDbType functions |
@@ -185,7 +189,7 @@ namespace OpenSim.Data.MSSQL | |||
185 | } | 189 | } |
186 | if (type == typeof(UUID)) | 190 | if (type == typeof(UUID)) |
187 | { | 191 | { |
188 | return SqlDbType.VarChar; | 192 | return SqlDbType.UniqueIdentifier; |
189 | } | 193 | } |
190 | if (type == typeof(sbyte)) | 194 | if (type == typeof(sbyte)) |
191 | { | 195 | { |
@@ -215,13 +219,13 @@ namespace OpenSim.Data.MSSQL | |||
215 | { | 219 | { |
216 | Type valueType = value.GetType(); | 220 | Type valueType = value.GetType(); |
217 | 221 | ||
218 | if (valueType == typeof(UUID)) | 222 | if (valueType == typeof(UUID)) //TODO check if this works |
219 | { | 223 | { |
220 | return value.ToString(); | 224 | return ((UUID) value).Guid; |
221 | } | 225 | } |
222 | if (valueType == typeof(UUID)) | 226 | if (valueType == typeof(UUID)) |
223 | { | 227 | { |
224 | return value.ToString(); | 228 | return ((UUID)value).Guid; |
225 | } | 229 | } |
226 | if (valueType == typeof(bool)) | 230 | if (valueType == typeof(bool)) |
227 | { | 231 | { |