diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLAssetData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index c22f645..26cdd06 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -210,6 +210,20 @@ namespace OpenSim.Data.MySQL | |||
210 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", | 210 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", |
211 | _dbConnection.Connection); | 211 | _dbConnection.Connection); |
212 | 212 | ||
213 | string assetName = asset.Name; | ||
214 | if (asset.Name.Length > 64) | ||
215 | { | ||
216 | assetName = asset.Name.Substring(0, 64); | ||
217 | m_log.Warn("[ASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add"); | ||
218 | } | ||
219 | |||
220 | string assetDescription = asset.Description; | ||
221 | if (asset.Description.Length > 64) | ||
222 | { | ||
223 | assetDescription = asset.Description.Substring(0, 64); | ||
224 | m_log.Warn("[ASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add"); | ||
225 | } | ||
226 | |||
213 | // need to ensure we dispose | 227 | // need to ensure we dispose |
214 | try | 228 | try |
215 | { | 229 | { |
@@ -218,8 +232,8 @@ namespace OpenSim.Data.MySQL | |||
218 | // create unix epoch time | 232 | // create unix epoch time |
219 | int now = (int)((DateTime.Now.Ticks - TicksToEpoch) / 10000000); | 233 | int now = (int)((DateTime.Now.Ticks - TicksToEpoch) / 10000000); |
220 | cmd.Parameters.AddWithValue("?id", asset.ID); | 234 | cmd.Parameters.AddWithValue("?id", asset.ID); |
221 | cmd.Parameters.AddWithValue("?name", asset.Name); | 235 | cmd.Parameters.AddWithValue("?name", assetName); |
222 | cmd.Parameters.AddWithValue("?description", asset.Description); | 236 | cmd.Parameters.AddWithValue("?description", assetDescription); |
223 | cmd.Parameters.AddWithValue("?assetType", asset.Type); | 237 | cmd.Parameters.AddWithValue("?assetType", asset.Type); |
224 | cmd.Parameters.AddWithValue("?local", asset.Local); | 238 | cmd.Parameters.AddWithValue("?local", asset.Local); |
225 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); | 239 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); |