diff options
author | Diva Canto | 2013-02-27 20:50:03 -0800 |
---|---|---|
committer | Diva Canto | 2013-02-27 20:50:03 -0800 |
commit | 64b8ce73dabcf651beadcc11cbe94db69cc3ea0e (patch) | |
tree | ab7f3a63c166185a5fd9d6d5a7e36a18d63a9817 /OpenSim/Data | |
parent | Moved the HG default variables out of [Startup] and into their own section [H... (diff) | |
parent | Add comment to example region modules about need to add Assembly annotation i... (diff) | |
download | opensim-SC-64b8ce73dabcf651beadcc11cbe94db69cc3ea0e.zip opensim-SC-64b8ce73dabcf651beadcc11cbe94db69cc3ea0e.tar.gz opensim-SC-64b8ce73dabcf651beadcc11cbe94db69cc3ea0e.tar.bz2 opensim-SC-64b8ce73dabcf651beadcc11cbe94db69cc3ea0e.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLAssetData.cs | 8 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 8 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLXAssetData.cs | 8 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 28 |
4 files changed, 41 insertions, 11 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index c7488d8..f3e008d 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -163,14 +163,18 @@ namespace OpenSim.Data.MSSQL | |||
163 | if (asset.Name.Length > 64) | 163 | if (asset.Name.Length > 64) |
164 | { | 164 | { |
165 | assetName = asset.Name.Substring(0, 64); | 165 | assetName = asset.Name.Substring(0, 64); |
166 | m_log.Warn("[ASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add"); | 166 | m_log.WarnFormat( |
167 | "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", | ||
168 | asset.Name, asset.ID, asset.Name.Length, assetName.Length); | ||
167 | } | 169 | } |
168 | 170 | ||
169 | string assetDescription = asset.Description; | 171 | string assetDescription = asset.Description; |
170 | if (asset.Description.Length > 64) | 172 | if (asset.Description.Length > 64) |
171 | { | 173 | { |
172 | assetDescription = asset.Description.Substring(0, 64); | 174 | assetDescription = asset.Description.Substring(0, 64); |
173 | m_log.Warn("[ASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add"); | 175 | m_log.WarnFormat( |
176 | "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", | ||
177 | asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); | ||
174 | } | 178 | } |
175 | 179 | ||
176 | using (SqlConnection conn = new SqlConnection(m_connectionString)) | 180 | using (SqlConnection conn = new SqlConnection(m_connectionString)) |
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 73de64b..cf80b3d 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -173,14 +173,18 @@ namespace OpenSim.Data.MySQL | |||
173 | if (asset.Name.Length > 64) | 173 | if (asset.Name.Length > 64) |
174 | { | 174 | { |
175 | assetName = asset.Name.Substring(0, 64); | 175 | assetName = asset.Name.Substring(0, 64); |
176 | m_log.Warn("[ASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add"); | 176 | m_log.WarnFormat( |
177 | "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", | ||
178 | asset.Name, asset.ID, asset.Name.Length, assetName.Length); | ||
177 | } | 179 | } |
178 | 180 | ||
179 | string assetDescription = asset.Description; | 181 | string assetDescription = asset.Description; |
180 | if (asset.Description.Length > 64) | 182 | if (asset.Description.Length > 64) |
181 | { | 183 | { |
182 | assetDescription = asset.Description.Substring(0, 64); | 184 | assetDescription = asset.Description.Substring(0, 64); |
183 | m_log.Warn("[ASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add"); | 185 | m_log.WarnFormat( |
186 | "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", | ||
187 | asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); | ||
184 | } | 188 | } |
185 | 189 | ||
186 | try | 190 | try |
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs index e6ac22e..c2282c8 100644 --- a/OpenSim/Data/MySQL/MySQLXAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs | |||
@@ -204,14 +204,18 @@ namespace OpenSim.Data.MySQL | |||
204 | if (asset.Name.Length > 64) | 204 | if (asset.Name.Length > 64) |
205 | { | 205 | { |
206 | assetName = asset.Name.Substring(0, 64); | 206 | assetName = asset.Name.Substring(0, 64); |
207 | m_log.Warn("[XASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add"); | 207 | m_log.WarnFormat( |
208 | "[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", | ||
209 | asset.Name, asset.ID, asset.Name.Length, assetName.Length); | ||
208 | } | 210 | } |
209 | 211 | ||
210 | string assetDescription = asset.Description; | 212 | string assetDescription = asset.Description; |
211 | if (asset.Description.Length > 64) | 213 | if (asset.Description.Length > 64) |
212 | { | 214 | { |
213 | assetDescription = asset.Description.Substring(0, 64); | 215 | assetDescription = asset.Description.Substring(0, 64); |
214 | m_log.Warn("[XASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add"); | 216 | m_log.WarnFormat( |
217 | "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", | ||
218 | asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); | ||
215 | } | 219 | } |
216 | 220 | ||
217 | if (m_enableCompression) | 221 | if (m_enableCompression) |
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 61e7aaf..c32982e 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 void StoreAsset(AssetBase asset) | 134 | override public void 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)); |
@@ -163,8 +181,8 @@ namespace OpenSim.Data.SQLite | |||
163 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) | 181 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) |
164 | { | 182 | { |
165 | cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); | 183 | cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); |
166 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); | 184 | cmd.Parameters.Add(new SqliteParameter(":Name", assetName)); |
167 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); | 185 | cmd.Parameters.Add(new SqliteParameter(":Description", assetDescription)); |
168 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); | 186 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); |
169 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 187 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
170 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 188 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |