diff options
author | Brian McBee | 2007-11-26 16:39:00 +0000 |
---|---|---|
committer | Brian McBee | 2007-11-26 16:39:00 +0000 |
commit | 232613638ff9ad6be867c73f287482790669393c (patch) | |
tree | 65edbc1280a44c56762d6079e6a2b65603ec6149 /OpenSim/Framework/Data.MySQL/MySQLAssetData.cs | |
parent | * Disabled primitive count updates on Parcels for the moment, until we can mo... (diff) | |
download | opensim-SC-232613638ff9ad6be867c73f287482790669393c.zip opensim-SC-232613638ff9ad6be867c73f287482790669393c.tar.gz opensim-SC-232613638ff9ad6be867c73f287482790669393c.tar.bz2 opensim-SC-232613638ff9ad6be867c73f287482790669393c.tar.xz |
Attempt to handle MYSQL error fetching assets
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLAssetData.cs | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs index aa31d3c..38d0a8f 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs | |||
@@ -76,20 +76,27 @@ namespace OpenSim.Framework.Data.MySQL | |||
76 | _dbConnection.Connection); | 76 | _dbConnection.Connection); |
77 | MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); | 77 | MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); |
78 | p.Value = assetID.GetBytes(); | 78 | p.Value = assetID.GetBytes(); |
79 | using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 79 | try |
80 | { | 80 | { |
81 | if (dbReader.Read()) | 81 | using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
82 | { | 82 | { |
83 | asset = new AssetBase(); | 83 | if (dbReader.Read()) |
84 | asset.Data = (byte[]) dbReader["data"]; | 84 | { |
85 | asset.Description = (string) dbReader["description"]; | 85 | asset = new AssetBase(); |
86 | asset.FullID = assetID; | 86 | asset.Data = (byte[])dbReader["data"]; |
87 | asset.InvType = (sbyte) dbReader["invType"]; | 87 | asset.Description = (string)dbReader["description"]; |
88 | asset.Local = ((sbyte) dbReader["local"]) != 0 ? true : false; | 88 | asset.FullID = assetID; |
89 | asset.Name = (string) dbReader["name"]; | 89 | asset.InvType = (sbyte)dbReader["invType"]; |
90 | asset.Type = (sbyte) dbReader["assetType"]; | 90 | asset.Local = ((sbyte)dbReader["local"]) != 0 ? true : false; |
91 | asset.Name = (string)dbReader["name"]; | ||
92 | asset.Type = (sbyte)dbReader["assetType"]; | ||
93 | } | ||
91 | } | 94 | } |
92 | } | 95 | } |
96 | catch (Exception) | ||
97 | { | ||
98 | MainLog.Instance.Warn("ASSETS", "MySql failure fetching asset"); | ||
99 | } | ||
93 | } | 100 | } |
94 | return asset; | 101 | return asset; |
95 | } | 102 | } |