From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- OpenSim/Data/PGSQL/PGSQLAssetData.cs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'OpenSim/Data/PGSQL/PGSQLAssetData.cs') diff --git a/OpenSim/Data/PGSQL/PGSQLAssetData.cs b/OpenSim/Data/PGSQL/PGSQLAssetData.cs index 5d8b0a2..7b79521 100644 --- a/OpenSim/Data/PGSQL/PGSQLAssetData.cs +++ b/OpenSim/Data/PGSQL/PGSQLAssetData.cs @@ -149,37 +149,37 @@ namespace OpenSim.Data.PGSQL /// Create asset in m_database /// /// the asset - override public void StoreAsset(AssetBase asset) + override public bool StoreAsset(AssetBase asset) { - + string sql = @"UPDATE assets set name = :name, description = :description, " + "\"assetType\" " + @" = :assetType, local = :local, temporary = :temporary, creatorid = :creatorid, data = :data WHERE id=:id; INSERT INTO assets - (id, name, description, " + "\"assetType\" " + @", local, + (id, name, description, " + "\"assetType\" " + @", local, temporary, create_time, access_time, creatorid, asset_flags, data) - Select :id, :name, :description, :assetType, :local, + Select :id, :name, :description, :assetType, :local, :temporary, :create_time, :access_time, :creatorid, :asset_flags, :data - Where not EXISTS(SELECT * FROM assets WHERE id=:id) + Where not EXISTS(SELECT * FROM assets WHERE id=:id) "; - + string assetName = asset.Name; if (asset.Name.Length > AssetBase.MAX_ASSET_NAME) { assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME); m_log.WarnFormat( - "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", + "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Name, asset.ID, asset.Name.Length, assetName.Length); } - + string assetDescription = asset.Description; if (asset.Description.Length > 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 DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); } @@ -208,6 +208,7 @@ namespace OpenSim.Data.PGSQL m_log.Error("[ASSET DB]: Error storing item :" + e.Message + " sql "+sql); } } + return true; } @@ -277,7 +278,7 @@ namespace OpenSim.Data.PGSQL { List retList = new List(count); string sql = @" SELECT id, name, description, " + "\"assetType\"" + @", temporary, creatorid - FROM assets + FROM assets order by id limit :stop offset :start;"; -- cgit v1.1