From 5202ae7bb4b3e20aad762811195922da6926a54c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 24 Nov 2016 14:39:08 +0000 Subject: revert changes to asset desc size, my bad.. this field will possible go away in future --- OpenSim/Data/MySQL/MySQLAssetData.cs | 8 -------- OpenSim/Data/MySQL/MySQLXAssetData.cs | 10 +++++----- OpenSim/Data/PGSQL/PGSQLAssetData.cs | 10 +++++----- OpenSim/Data/SQLite/SQLiteAssetData.cs | 10 +++++----- 4 files changed, 15 insertions(+), 23 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 83e7e4c..1488e1a 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -170,14 +170,6 @@ namespace OpenSim.Data.MySQL } string assetDescription = asset.Description; - if(assetDescription.Length > AssetBase.MAX_LMASSET_DESC) - { - if(asset.Type == (sbyte) AssetType.Landmark) - assetDescription = assetDescription.Substring(0, AssetBase.MAX_LMASSET_DESC); - else - assetDescription = assetDescription.Substring(0, AssetBase.MAX_ASSET_DESC); - } - if (asset.Description.Length > AssetBase.MAX_ASSET_DESC) { assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs index 6c6f560..ec2bcc6 100644 --- a/OpenSim/Data/MySQL/MySQLXAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs @@ -214,12 +214,12 @@ namespace OpenSim.Data.MySQL } string assetDescription = asset.Description; - if(assetDescription.Length > AssetBase.MAX_LMASSET_DESC) + if (asset.Description.Length > AssetBase.MAX_ASSET_DESC) { - if(asset.Type == (sbyte) AssetType.Landmark) - assetDescription = assetDescription.Substring(0, AssetBase.MAX_LMASSET_DESC); - else - assetDescription = assetDescription.Substring(0, AssetBase.MAX_ASSET_DESC); + assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); + m_log.WarnFormat( + "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", + asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); } if (m_enableCompression) diff --git a/OpenSim/Data/PGSQL/PGSQLAssetData.cs b/OpenSim/Data/PGSQL/PGSQLAssetData.cs index 97ea6a4..81adb03 100644 --- a/OpenSim/Data/PGSQL/PGSQLAssetData.cs +++ b/OpenSim/Data/PGSQL/PGSQLAssetData.cs @@ -175,12 +175,12 @@ namespace OpenSim.Data.PGSQL } string assetDescription = asset.Description; - if(assetDescription.Length > AssetBase.MAX_LMASSET_DESC) + if (asset.Description.Length > AssetBase.MAX_ASSET_DESC) { - if(asset.Type == (sbyte) AssetType.Landmark) - assetDescription = assetDescription.Substring(0, AssetBase.MAX_LMASSET_DESC); - else - assetDescription = assetDescription.Substring(0, AssetBase.MAX_ASSET_DESC); + assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); + m_log.WarnFormat( + "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", + asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); } using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 9fbd9c7..9c2bd2e 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -143,12 +143,12 @@ namespace OpenSim.Data.SQLite } string assetDescription = asset.Description; - if(assetDescription.Length > AssetBase.MAX_LMASSET_DESC) + if (asset.Description.Length > AssetBase.MAX_ASSET_DESC) { - if(asset.Type == (sbyte) AssetType.Landmark) - assetDescription = assetDescription.Substring(0, AssetBase.MAX_LMASSET_DESC); - else - assetDescription = assetDescription.Substring(0, AssetBase.MAX_ASSET_DESC); + assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); + m_log.WarnFormat( + "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", + asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); } //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); -- cgit v1.1