aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MySQL
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLAssetData.cs30
1 files changed, 16 insertions, 14 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
index a8f0fdb..0112474 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
@@ -71,22 +71,24 @@ namespace OpenSim.Framework.Data.MySQL
71 public AssetBase FetchAsset(LLUUID assetID) 71 public AssetBase FetchAsset(LLUUID assetID)
72 { 72 {
73 AssetBase asset = null; 73 AssetBase asset = null;
74 74 lock (_dbConnection)
75 MySqlCommand cmd = new MySqlCommand("SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection);
76 MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
77 p.Value = assetID.GetBytes();
78 using (MySqlDataReader dbReader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow))
79 { 75 {
80 if (dbReader.Read()) 76 MySqlCommand cmd = new MySqlCommand("SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection);
77 MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
78 p.Value = assetID.GetBytes();
79 using (MySqlDataReader dbReader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow))
81 { 80 {
82 asset = new AssetBase(); 81 if (dbReader.Read())
83 asset.Data = (byte[])dbReader["data"]; 82 {
84 asset.Description = (string)dbReader["description"]; 83 asset = new AssetBase();
85 asset.FullID = assetID; 84 asset.Data = (byte[])dbReader["data"];
86 asset.InvType = (sbyte)dbReader["invType"]; 85 asset.Description = (string)dbReader["description"];
87 asset.Local = ((sbyte)dbReader["local"]) != 0 ? true : false; 86 asset.FullID = assetID;
88 asset.Name = (string)dbReader["name"]; 87 asset.InvType = (sbyte)dbReader["invType"];
89 asset.Type = (sbyte)dbReader["assetType"]; 88 asset.Local = ((sbyte)dbReader["local"]) != 0 ? true : false;
89 asset.Name = (string)dbReader["name"];
90 asset.Type = (sbyte)dbReader["assetType"];
91 }
90 } 92 }
91 } 93 }
92 return asset; 94 return asset;