aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteAssetData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteAssetData.cs')
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs28
1 files changed, 23 insertions, 5 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index b94a58c..82320ca 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Data.SQLite
46 /// </summary> 46 /// </summary>
47 public class SQLiteAssetData : AssetDataBase 47 public class SQLiteAssetData : AssetDataBase
48 { 48 {
49// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; 51 private const string SelectAssetSQL = "select * from assets where UUID=:UUID";
52 private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, asset_flags, UUID, CreatorID from assets limit :start, :count"; 52 private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, asset_flags, UUID, CreatorID from assets limit :start, :count";
@@ -133,6 +133,24 @@ namespace OpenSim.Data.SQLite
133 /// <param name="asset">Asset Base</param> 133 /// <param name="asset">Asset Base</param>
134 override public bool StoreAsset(AssetBase asset) 134 override public bool StoreAsset(AssetBase asset)
135 { 135 {
136 string assetName = asset.Name;
137 if (asset.Name.Length > 64)
138 {
139 assetName = asset.Name.Substring(0, 64);
140 m_log.WarnFormat(
141 "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
142 asset.Name, asset.ID, asset.Name.Length, assetName.Length);
143 }
144
145 string assetDescription = asset.Description;
146 if (asset.Description.Length > 64)
147 {
148 assetDescription = asset.Description.Substring(0, 64);
149 m_log.WarnFormat(
150 "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
151 asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
152 }
153
136 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); 154 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
137 if (ExistsAsset(asset.FullID)) 155 if (ExistsAsset(asset.FullID))
138 { 156 {
@@ -143,8 +161,8 @@ namespace OpenSim.Data.SQLite
143 using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) 161 using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn))
144 { 162 {
145 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); 163 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString()));
146 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); 164 cmd.Parameters.Add(new SqliteParameter(":Name", assetName));
147 cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); 165 cmd.Parameters.Add(new SqliteParameter(":Description", assetDescription));
148 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); 166 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type));
149 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); 167 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
150 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); 168 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
@@ -164,8 +182,8 @@ namespace OpenSim.Data.SQLite
164 using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) 182 using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn))
165 { 183 {
166 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); 184 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString()));
167 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); 185 cmd.Parameters.Add(new SqliteParameter(":Name", assetName));
168 cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); 186 cmd.Parameters.Add(new SqliteParameter(":Description", assetDescription));
169 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); 187 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type));
170 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); 188 cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
171 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); 189 cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));