diff options
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteAssetData.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 2783ba1..7081f99 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -44,10 +44,10 @@ namespace OpenSim.Data.SQLite | |||
44 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; | 46 | private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; |
47 | private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, UUID from assets limit :start, :count"; | 47 | private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, asset_flags, UUID from assets limit :start, :count"; |
48 | private const string DeleteAssetSQL = "delete from assets where UUID=:UUID"; | 48 | private const string DeleteAssetSQL = "delete from assets where UUID=:UUID"; |
49 | private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, Local, Temporary, Data) values(:UUID, :Name, :Description, :Type, :Local, :Temporary, :Data)"; | 49 | private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, Local, Temporary, asset_flags, Data) values(:UUID, :Name, :Description, :Type, :Local, :Temporary, :Flags, :Data)"; |
50 | private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, Local=:Local, Temporary=:Temporary, Data=:Data where UUID=:UUID"; | 50 | private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, Local=:Local, Temporary=:Temporary, asset_flags=:Flags, Data=:Data where UUID=:UUID"; |
51 | private const string assetSelect = "select * from assets"; | 51 | private const string assetSelect = "select * from assets"; |
52 | 52 | ||
53 | private SqliteConnection m_conn; | 53 | private SqliteConnection m_conn; |
@@ -136,6 +136,7 @@ namespace OpenSim.Data.SQLite | |||
136 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); | 136 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); |
137 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 137 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
138 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 138 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
139 | cmd.Parameters.Add(new SqliteParameter(":Flags", asset.Flags)); | ||
139 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 140 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
140 | 141 | ||
141 | cmd.ExecuteNonQuery(); | 142 | cmd.ExecuteNonQuery(); |
@@ -154,6 +155,7 @@ namespace OpenSim.Data.SQLite | |||
154 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); | 155 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); |
155 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 156 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
156 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 157 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
158 | cmd.Parameters.Add(new SqliteParameter(":Flags", asset.Flags)); | ||
157 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 159 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
158 | 160 | ||
159 | cmd.ExecuteNonQuery(); | 161 | cmd.ExecuteNonQuery(); |
@@ -227,7 +229,8 @@ namespace OpenSim.Data.SQLite | |||
227 | asset.Description = (String) row["Description"]; | 229 | asset.Description = (String) row["Description"]; |
228 | asset.Local = Convert.ToBoolean(row["Local"]); | 230 | asset.Local = Convert.ToBoolean(row["Local"]); |
229 | asset.Temporary = Convert.ToBoolean(row["Temporary"]); | 231 | asset.Temporary = Convert.ToBoolean(row["Temporary"]); |
230 | asset.Data = (byte[]) row["Data"]; | 232 | asset.Flags = (AssetFlags)Convert.ToInt32(row["asset_flags"]); |
233 | asset.Data = (byte[])row["Data"]; | ||
231 | return asset; | 234 | return asset; |
232 | } | 235 | } |
233 | 236 | ||
@@ -240,6 +243,7 @@ namespace OpenSim.Data.SQLite | |||
240 | metadata.Description = (string) row["Description"]; | 243 | metadata.Description = (string) row["Description"]; |
241 | metadata.Type = Convert.ToSByte(row["Type"]); | 244 | metadata.Type = Convert.ToSByte(row["Type"]); |
242 | metadata.Temporary = Convert.ToBoolean(row["Temporary"]); // Not sure if this is correct. | 245 | metadata.Temporary = Convert.ToBoolean(row["Temporary"]); // Not sure if this is correct. |
246 | metadata.Flags = (AssetFlags)Convert.ToInt32(row["asset_flags"]); | ||
243 | 247 | ||
244 | // Current SHA1s are not stored/computed. | 248 | // Current SHA1s are not stored/computed. |
245 | metadata.SHA1 = new byte[] {}; | 249 | metadata.SHA1 = new byte[] {}; |