aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/SQLite/Resources/004_AssetStore.sql7
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs12
2 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Data/SQLite/Resources/004_AssetStore.sql b/OpenSim/Data/SQLite/Resources/004_AssetStore.sql
new file mode 100644
index 0000000..721f2b5
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/004_AssetStore.sql
@@ -0,0 +1,7 @@
1BEGIN;
2
3update assets
4 set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21)
5 where UUID not like '%-%';
6
7COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 6a323e1..5a5260a 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -102,7 +102,7 @@ namespace OpenSim.Data.SQLite
102 { 102 {
103 using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) 103 using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
104 { 104 {
105 cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid))); 105 cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString()));
106 using (IDataReader reader = cmd.ExecuteReader()) 106 using (IDataReader reader = cmd.ExecuteReader())
107 { 107 {
108 if (reader.Read()) 108 if (reader.Read())
@@ -127,7 +127,7 @@ namespace OpenSim.Data.SQLite
127 /// <param name="asset">Asset Base</param> 127 /// <param name="asset">Asset Base</param>
128 override public void CreateAsset(AssetBase asset) 128 override public void CreateAsset(AssetBase asset)
129 { 129 {
130 //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.FullID)); 130 //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
131 if (ExistsAsset(asset.FullID)) 131 if (ExistsAsset(asset.FullID))
132 { 132 {
133 //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); 133 //m_log.Info("[ASSET DB]: Asset exists already, ignoring.");
@@ -138,7 +138,7 @@ namespace OpenSim.Data.SQLite
138 { 138 {
139 using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) 139 using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn))
140 { 140 {
141 cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); 141 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString()));
142 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); 142 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name));
143 cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); 143 cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description));
144 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); 144 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type));
@@ -164,7 +164,7 @@ namespace OpenSim.Data.SQLite
164 { 164 {
165 using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) 165 using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn))
166 { 166 {
167 cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); 167 cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString()));
168 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); 168 cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name));
169 cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); 169 cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description));
170 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); 170 cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type));
@@ -204,7 +204,7 @@ namespace OpenSim.Data.SQLite
204 lock (this) { 204 lock (this) {
205 using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) 205 using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
206 { 206 {
207 cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid))); 207 cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString()));
208 using (IDataReader reader = cmd.ExecuteReader()) 208 using (IDataReader reader = cmd.ExecuteReader())
209 { 209 {
210 if (reader.Read()) 210 if (reader.Read())
@@ -230,7 +230,7 @@ namespace OpenSim.Data.SQLite
230 { 230 {
231 using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn)) 231 using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn))
232 { 232 {
233 cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid))); 233 cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString()));
234 234
235 cmd.ExecuteNonQuery(); 235 cmd.ExecuteNonQuery();
236 } 236 }