diff options
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/DBGuids.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/Migration.cs | 14 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 22 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 57 | ||||
-rw-r--r-- | OpenSim/Data/Tests/BasicDataServiceTest.cs | 10 |
8 files changed, 58 insertions, 61 deletions
diff --git a/OpenSim/Data/DBGuids.cs b/OpenSim/Data/DBGuids.cs index c40e8bb..ad1c19c 100644 --- a/OpenSim/Data/DBGuids.cs +++ b/OpenSim/Data/DBGuids.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Data | |||
44 | /// <returns></returns> | 44 | /// <returns></returns> |
45 | public static UUID FromDB(object id) | 45 | public static UUID FromDB(object id) |
46 | { | 46 | { |
47 | if( (id == null) || (id == DBNull.Value)) | 47 | if ((id == null) || (id == DBNull.Value)) |
48 | return UUID.Zero; | 48 | return UUID.Zero; |
49 | 49 | ||
50 | if (id.GetType() == typeof(Guid)) | 50 | if (id.GetType() == typeof(Guid)) |
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index ae105d5..e4bfc28 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs | |||
@@ -1126,7 +1126,7 @@ VALUES | |||
1126 | prim.LinkNum = Convert.ToInt32(primRow["LinkNumber"]); | 1126 | prim.LinkNum = Convert.ToInt32(primRow["LinkNumber"]); |
1127 | 1127 | ||
1128 | if (!(primRow["MediaURL"] is System.DBNull)) | 1128 | if (!(primRow["MediaURL"] is System.DBNull)) |
1129 | prim.MediaUrl = (string)primRow["MediaURL"]; | 1129 | prim.MediaUrl = (string)primRow["MediaURL"]; |
1130 | 1130 | ||
1131 | return prim; | 1131 | return prim; |
1132 | } | 1132 | } |
@@ -1180,7 +1180,7 @@ VALUES | |||
1180 | { | 1180 | { |
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | if (!(shapeRow["Media"] is System.DBNull)) | 1183 | if (!(shapeRow["Media"] is System.DBNull)) |
1184 | baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); | 1184 | baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); |
1185 | 1185 | ||
1186 | return baseShape; | 1186 | return baseShape; |
@@ -1511,7 +1511,7 @@ VALUES | |||
1511 | parameters.Add(_Database.CreateParameter("PassTouches", 1)); | 1511 | parameters.Add(_Database.CreateParameter("PassTouches", 1)); |
1512 | else | 1512 | else |
1513 | parameters.Add(_Database.CreateParameter("PassTouches", 0)); | 1513 | parameters.Add(_Database.CreateParameter("PassTouches", 0)); |
1514 | parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); | 1514 | parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); |
1515 | parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); | 1515 | parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); |
1516 | 1516 | ||
1517 | return parameters.ToArray(); | 1517 | return parameters.ToArray(); |
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 86531d9..fc9a142 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs | |||
@@ -122,7 +122,7 @@ namespace OpenSim.Data | |||
122 | int ver = FindVersion(_conn, "migrations"); | 122 | int ver = FindVersion(_conn, "migrations"); |
123 | if (ver <= 0) // -1 = no table, 0 = no version record | 123 | if (ver <= 0) // -1 = no table, 0 = no version record |
124 | { | 124 | { |
125 | if( ver < 0 ) | 125 | if (ver < 0) |
126 | ExecuteScript("create table migrations(name varchar(100), version int)"); | 126 | ExecuteScript("create table migrations(name varchar(100), version int)"); |
127 | InsertVersion("migrations", 1); | 127 | InsertVersion("migrations", 1); |
128 | } | 128 | } |
@@ -288,7 +288,7 @@ namespace OpenSim.Data | |||
288 | SortedList<int, string[]> migrations = new SortedList<int, string[]>(); | 288 | SortedList<int, string[]> migrations = new SortedList<int, string[]>(); |
289 | 289 | ||
290 | string[] names = _assem.GetManifestResourceNames(); | 290 | string[] names = _assem.GetManifestResourceNames(); |
291 | if( names.Length == 0 ) // should never happen | 291 | if (names.Length == 0) // should never happen |
292 | return migrations; | 292 | return migrations; |
293 | 293 | ||
294 | Array.Sort(names); // we want all the migrations ordered | 294 | Array.Sort(names); // we want all the migrations ordered |
@@ -297,7 +297,7 @@ namespace OpenSim.Data | |||
297 | Match m = null; | 297 | Match m = null; |
298 | string sFile = Array.FindLast(names, nm => { m = _match_new.Match(nm); return m.Success; }); // ; nm.StartsWith(sPrefix, StringComparison.InvariantCultureIgnoreCase | 298 | string sFile = Array.FindLast(names, nm => { m = _match_new.Match(nm); return m.Success; }); // ; nm.StartsWith(sPrefix, StringComparison.InvariantCultureIgnoreCase |
299 | 299 | ||
300 | if( (m != null) && !String.IsNullOrEmpty(sFile) ) | 300 | if ((m != null) && !String.IsNullOrEmpty(sFile)) |
301 | { | 301 | { |
302 | /* The filename should be '<StoreName>.migrations[.NNN]' where NNN | 302 | /* The filename should be '<StoreName>.migrations[.NNN]' where NNN |
303 | * is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip | 303 | * is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip |
@@ -312,7 +312,7 @@ namespace OpenSim.Data | |||
312 | 312 | ||
313 | if (m.Groups.Count > 1 && int.TryParse(m.Groups[1].Value, out nLastVerFound)) | 313 | if (m.Groups.Count > 1 && int.TryParse(m.Groups[1].Value, out nLastVerFound)) |
314 | { | 314 | { |
315 | if( nLastVerFound <= after ) | 315 | if (nLastVerFound <= after) |
316 | goto scan_old_style; | 316 | goto scan_old_style; |
317 | } | 317 | } |
318 | 318 | ||
@@ -329,7 +329,7 @@ namespace OpenSim.Data | |||
329 | sb.Length = 0; | 329 | sb.Length = 0; |
330 | } | 330 | } |
331 | 331 | ||
332 | if ( (nVersion > 0) && (nVersion > after) && (script.Count > 0) && !migrations.ContainsKey(nVersion)) // script to the versioned script list | 332 | if ((nVersion > 0) && (nVersion > after) && (script.Count > 0) && !migrations.ContainsKey(nVersion)) // script to the versioned script list |
333 | { | 333 | { |
334 | migrations[nVersion] = script.ToArray(); | 334 | migrations[nVersion] = script.ToArray(); |
335 | } | 335 | } |
@@ -345,7 +345,7 @@ namespace OpenSim.Data | |||
345 | string sLine = resourceReader.ReadLine(); | 345 | string sLine = resourceReader.ReadLine(); |
346 | nLineNo++; | 346 | nLineNo++; |
347 | 347 | ||
348 | if( String.IsNullOrEmpty(sLine) || sLine.StartsWith("#") ) // ignore a comment or empty line | 348 | if (String.IsNullOrEmpty(sLine) || sLine.StartsWith("#")) // ignore a comment or empty line |
349 | continue; | 349 | continue; |
350 | 350 | ||
351 | if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase)) | 351 | if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase)) |
@@ -392,7 +392,7 @@ scan_old_style: | |||
392 | if (m.Success) | 392 | if (m.Success) |
393 | { | 393 | { |
394 | int version = int.Parse(m.Groups[1].ToString()); | 394 | int version = int.Parse(m.Groups[1].ToString()); |
395 | if ( (version > after) && !migrations.ContainsKey(version) ) | 395 | if ((version > after) && !migrations.ContainsKey(version)) |
396 | { | 396 | { |
397 | using (Stream resource = _assem.GetManifestResourceStream(s)) | 397 | using (Stream resource = _assem.GetManifestResourceStream(s)) |
398 | { | 398 | { |
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 0aea30f..2dca3eb 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -286,7 +286,7 @@ namespace OpenSim.Data.MySQL | |||
286 | InventoryItemBase item = new InventoryItemBase(); | 286 | InventoryItemBase item = new InventoryItemBase(); |
287 | 287 | ||
288 | // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these. | 288 | // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these. |
289 | // ( DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero ) | 289 | // (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero) |
290 | item.CreatorId = reader["creatorID"].ToString(); | 290 | item.CreatorId = reader["creatorID"].ToString(); |
291 | 291 | ||
292 | // Be a bit safer in parsing these because the | 292 | // Be a bit safer in parsing these because the |
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 36f73ef..8201cef 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -680,7 +680,7 @@ namespace OpenSim.Data.MySQL | |||
680 | "UserLocationX, UserLocationY, UserLocationZ, " + | 680 | "UserLocationX, UserLocationY, UserLocationZ, " + |
681 | "UserLookAtX, UserLookAtY, UserLookAtZ, " + | 681 | "UserLookAtX, UserLookAtY, UserLookAtZ, " + |
682 | "AuthbuyerID, OtherCleanTime, MediaType, MediaDescription, " + | 682 | "AuthbuyerID, OtherCleanTime, MediaType, MediaDescription, " + |
683 | "MediaSize, MediaLoop, ObscureMusic, ObscureMedia) values (" + | 683 | "MediaSize, MediaLoop, ObscureMusic, ObscureMedia) values (" + |
684 | "?UUID, ?RegionUUID, " + | 684 | "?UUID, ?RegionUUID, " + |
685 | "?LocalLandID, ?Bitmap, ?Name, ?Description, " + | 685 | "?LocalLandID, ?Bitmap, ?Name, ?Description, " + |
686 | "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " + | 686 | "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " + |
@@ -691,7 +691,7 @@ namespace OpenSim.Data.MySQL | |||
691 | "?UserLocationX, ?UserLocationY, ?UserLocationZ, " + | 691 | "?UserLocationX, ?UserLocationY, ?UserLocationZ, " + |
692 | "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + | 692 | "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + |
693 | "?AuthbuyerID, ?OtherCleanTime, ?MediaType, ?MediaDescription, "+ | 693 | "?AuthbuyerID, ?OtherCleanTime, ?MediaType, ?MediaDescription, "+ |
694 | "CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia)"; | 694 | "CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia)"; |
695 | 695 | ||
696 | FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID); | 696 | FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID); |
697 | 697 | ||
@@ -728,7 +728,7 @@ namespace OpenSim.Data.MySQL | |||
728 | 728 | ||
729 | string command = "select * from `regionwindlight` where region_id = ?regionID"; | 729 | string command = "select * from `regionwindlight` where region_id = ?regionID"; |
730 | 730 | ||
731 | using(MySqlCommand cmd = new MySqlCommand(command)) | 731 | using (MySqlCommand cmd = new MySqlCommand(command)) |
732 | { | 732 | { |
733 | cmd.Connection = dbcon; | 733 | cmd.Connection = dbcon; |
734 | 734 | ||
@@ -1350,13 +1350,13 @@ namespace OpenSim.Data.MySQL | |||
1350 | m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); | 1350 | m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); |
1351 | } | 1351 | } |
1352 | 1352 | ||
1353 | newData.MediaDescription = (string) row["MediaDescription"]; | 1353 | newData.MediaDescription = (string) row["MediaDescription"]; |
1354 | newData.MediaType = (string) row["MediaType"]; | 1354 | newData.MediaType = (string) row["MediaType"]; |
1355 | newData.MediaWidth = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[0]); | 1355 | newData.MediaWidth = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[0]); |
1356 | newData.MediaHeight = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[1]); | 1356 | newData.MediaHeight = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[1]); |
1357 | newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]); | 1357 | newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]); |
1358 | newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); | 1358 | newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); |
1359 | newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); | 1359 | newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); |
1360 | 1360 | ||
1361 | newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); | 1361 | newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); |
1362 | 1362 | ||
@@ -1724,7 +1724,7 @@ namespace OpenSim.Data.MySQL | |||
1724 | 1724 | ||
1725 | s.State = (byte)(int)row["State"]; | 1725 | s.State = (byte)(int)row["State"]; |
1726 | 1726 | ||
1727 | if (!(row["Media"] is System.DBNull)) | 1727 | if (!(row["Media"] is System.DBNull)) |
1728 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); | 1728 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); |
1729 | 1729 | ||
1730 | return s; | 1730 | return s; |
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index ece2495..ecf8e02 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |||
@@ -731,12 +731,12 @@ namespace OpenSim.Data.SQLite | |||
731 | **********************************************************************/ | 731 | **********************************************************************/ |
732 | 732 | ||
733 | protected void CreateDataSetMapping(IDataAdapter da, string tableName) | 733 | protected void CreateDataSetMapping(IDataAdapter da, string tableName) |
734 | { | 734 | { |
735 | ITableMapping dbMapping = da.TableMappings.Add(tableName, tableName); | 735 | ITableMapping dbMapping = da.TableMappings.Add(tableName, tableName); |
736 | foreach (DataColumn col in ds.Tables[tableName].Columns) | 736 | foreach (DataColumn col in ds.Tables[tableName].Columns) |
737 | { | 737 | { |
738 | dbMapping.ColumnMappings.Add(col.ColumnName, col.ColumnName); | 738 | dbMapping.ColumnMappings.Add(col.ColumnName, col.ColumnName); |
739 | } | 739 | } |
740 | } | 740 | } |
741 | 741 | ||
742 | /// <summary> | 742 | /// <summary> |
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 1820f78..7460961 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -176,7 +176,7 @@ namespace OpenSim.Data.SQLite | |||
176 | { | 176 | { |
177 | m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table"); | 177 | m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table"); |
178 | } | 178 | } |
179 | 179 | ||
180 | try | 180 | try |
181 | { | 181 | { |
182 | terrainDa.Fill(ds.Tables["terrain"]); | 182 | terrainDa.Fill(ds.Tables["terrain"]); |
@@ -510,7 +510,7 @@ namespace OpenSim.Data.SQLite | |||
510 | "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape"); | 510 | "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape"); |
511 | prim.Shape = PrimitiveBaseShape.Default; | 511 | prim.Shape = PrimitiveBaseShape.Default; |
512 | } | 512 | } |
513 | 513 | ||
514 | createdObjects[new UUID(objID)].AddPart(prim); | 514 | createdObjects[new UUID(objID)].AddPart(prim); |
515 | LoadItems(prim); | 515 | LoadItems(prim); |
516 | } | 516 | } |
@@ -534,17 +534,17 @@ namespace OpenSim.Data.SQLite | |||
534 | /// </summary> | 534 | /// </summary> |
535 | /// <param name="prim">the prim</param> | 535 | /// <param name="prim">the prim</param> |
536 | private void LoadItems(SceneObjectPart prim) | 536 | private void LoadItems(SceneObjectPart prim) |
537 | { | 537 | { |
538 | // m_log.DebugFormat("[SQLITE REGION DB]: Loading inventory for {0} {1}", prim.Name, prim.UUID); | 538 | // m_log.DebugFormat("[SQLITE REGION DB]: Loading inventory for {0} {1}", prim.Name, prim.UUID); |
539 | 539 | ||
540 | DataTable dbItems = ds.Tables["primitems"]; | 540 | DataTable dbItems = ds.Tables["primitems"]; |
541 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); | 541 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); |
542 | DataRow[] dbItemRows = dbItems.Select(sql); | 542 | DataRow[] dbItemRows = dbItems.Select(sql); |
543 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); | 543 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); |
544 | 544 | ||
545 | // m_log.DebugFormat( | 545 | // m_log.DebugFormat( |
546 | // "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID); | 546 | // "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID); |
547 | 547 | ||
548 | foreach (DataRow row in dbItemRows) | 548 | foreach (DataRow row in dbItemRows) |
549 | { | 549 | { |
550 | TaskInventoryItem item = buildItem(row); | 550 | TaskInventoryItem item = buildItem(row); |
@@ -693,8 +693,6 @@ namespace OpenSim.Data.SQLite | |||
693 | { | 693 | { |
694 | landaccesslist.Rows.Remove(rowsToDelete[iter]); | 694 | landaccesslist.Rows.Remove(rowsToDelete[iter]); |
695 | } | 695 | } |
696 | |||
697 | |||
698 | } | 696 | } |
699 | Commit(); | 697 | Commit(); |
700 | } | 698 | } |
@@ -804,7 +802,7 @@ namespace OpenSim.Data.SQLite | |||
804 | try | 802 | try |
805 | { | 803 | { |
806 | regionSettingsDa.Update(ds, "regionsettings"); | 804 | regionSettingsDa.Update(ds, "regionsettings"); |
807 | } | 805 | } |
808 | catch (SqliteException SqlEx) | 806 | catch (SqliteException SqlEx) |
809 | { | 807 | { |
810 | throw new Exception( | 808 | throw new Exception( |
@@ -974,7 +972,7 @@ namespace OpenSim.Data.SQLite | |||
974 | createCol(prims, "CollisionSoundVolume", typeof(Double)); | 972 | createCol(prims, "CollisionSoundVolume", typeof(Double)); |
975 | 973 | ||
976 | createCol(prims, "VolumeDetect", typeof(Int16)); | 974 | createCol(prims, "VolumeDetect", typeof(Int16)); |
977 | 975 | ||
978 | createCol(prims, "MediaURL", typeof(String)); | 976 | createCol(prims, "MediaURL", typeof(String)); |
979 | 977 | ||
980 | // Add in contraints | 978 | // Add in contraints |
@@ -1191,10 +1189,10 @@ namespace OpenSim.Data.SQLite | |||
1191 | private SceneObjectPart buildPrim(DataRow row) | 1189 | private SceneObjectPart buildPrim(DataRow row) |
1192 | { | 1190 | { |
1193 | // Code commented. Uncomment to test the unit test inline. | 1191 | // Code commented. Uncomment to test the unit test inline. |
1194 | 1192 | ||
1195 | // The unit test mentions this commented code for the purposes | 1193 | // The unit test mentions this commented code for the purposes |
1196 | // of debugging a unit test failure | 1194 | // of debugging a unit test failure |
1197 | 1195 | ||
1198 | // SceneObjectGroup sog = new SceneObjectGroup(); | 1196 | // SceneObjectGroup sog = new SceneObjectGroup(); |
1199 | // SceneObjectPart sop = new SceneObjectPart(); | 1197 | // SceneObjectPart sop = new SceneObjectPart(); |
1200 | // sop.LocalId = 1; | 1198 | // sop.LocalId = 1; |
@@ -1211,7 +1209,7 @@ namespace OpenSim.Data.SQLite | |||
1211 | // TODO: this doesn't work yet because something more | 1209 | // TODO: this doesn't work yet because something more |
1212 | // interesting has to be done to actually get these values | 1210 | // interesting has to be done to actually get these values |
1213 | // back out. Not enough time to figure it out yet. | 1211 | // back out. Not enough time to figure it out yet. |
1214 | 1212 | ||
1215 | SceneObjectPart prim = new SceneObjectPart(); | 1213 | SceneObjectPart prim = new SceneObjectPart(); |
1216 | prim.UUID = new UUID((String) row["UUID"]); | 1214 | prim.UUID = new UUID((String) row["UUID"]); |
1217 | // explicit conversion of integers is required, which sort | 1215 | // explicit conversion of integers is required, which sort |
@@ -1341,7 +1339,7 @@ namespace OpenSim.Data.SQLite | |||
1341 | 1339 | ||
1342 | if (Convert.ToInt16(row["VolumeDetect"]) != 0) | 1340 | if (Convert.ToInt16(row["VolumeDetect"]) != 0) |
1343 | prim.VolumeDetectActive = true; | 1341 | prim.VolumeDetectActive = true; |
1344 | 1342 | ||
1345 | if (!(row["MediaURL"] is System.DBNull)) | 1343 | if (!(row["MediaURL"] is System.DBNull)) |
1346 | { | 1344 | { |
1347 | //m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); | 1345 | //m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); |
@@ -1680,7 +1678,7 @@ namespace OpenSim.Data.SQLite | |||
1680 | row["VolumeDetect"] = 1; | 1678 | row["VolumeDetect"] = 1; |
1681 | else | 1679 | else |
1682 | row["VolumeDetect"] = 0; | 1680 | row["VolumeDetect"] = 0; |
1683 | 1681 | ||
1684 | row["MediaURL"] = prim.MediaUrl; | 1682 | row["MediaURL"] = prim.MediaUrl; |
1685 | } | 1683 | } |
1686 | 1684 | ||
@@ -1758,12 +1756,12 @@ namespace OpenSim.Data.SQLite | |||
1758 | row["UserLookAtZ"] = land.UserLookAt.Z; | 1756 | row["UserLookAtZ"] = land.UserLookAt.Z; |
1759 | row["AuthbuyerID"] = land.AuthBuyerID.ToString(); | 1757 | row["AuthbuyerID"] = land.AuthBuyerID.ToString(); |
1760 | row["OtherCleanTime"] = land.OtherCleanTime; | 1758 | row["OtherCleanTime"] = land.OtherCleanTime; |
1761 | row["MediaType"] = land.MediaType; | 1759 | row["MediaType"] = land.MediaType; |
1762 | row["MediaDescription"] = land.MediaDescription; | 1760 | row["MediaDescription"] = land.MediaDescription; |
1763 | row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString(); | 1761 | row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString(); |
1764 | row["MediaLoop"] = land.MediaLoop.ToString(); | 1762 | row["MediaLoop"] = land.MediaLoop.ToString(); |
1765 | row["ObscureMusic"] = land.ObscureMusic.ToString(); | 1763 | row["ObscureMusic"] = land.ObscureMusic.ToString(); |
1766 | row["ObscureMedia"] = land.ObscureMedia.ToString(); | 1764 | row["ObscureMedia"] = land.ObscureMedia.ToString(); |
1767 | } | 1765 | } |
1768 | 1766 | ||
1769 | /// <summary> | 1767 | /// <summary> |
@@ -1861,10 +1859,10 @@ namespace OpenSim.Data.SQLite | |||
1861 | s.TextureEntry = textureEntry; | 1859 | s.TextureEntry = textureEntry; |
1862 | 1860 | ||
1863 | s.ExtraParams = (byte[]) row["ExtraParams"]; | 1861 | s.ExtraParams = (byte[]) row["ExtraParams"]; |
1864 | 1862 | ||
1865 | if (!(row["Media"] is System.DBNull)) | 1863 | if (!(row["Media"] is System.DBNull)) |
1866 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); | 1864 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); |
1867 | 1865 | ||
1868 | return s; | 1866 | return s; |
1869 | } | 1867 | } |
1870 | 1868 | ||
@@ -1908,7 +1906,7 @@ namespace OpenSim.Data.SQLite | |||
1908 | 1906 | ||
1909 | row["Texture"] = s.TextureEntry; | 1907 | row["Texture"] = s.TextureEntry; |
1910 | row["ExtraParams"] = s.ExtraParams; | 1908 | row["ExtraParams"] = s.ExtraParams; |
1911 | 1909 | ||
1912 | if (s.Media != null) | 1910 | if (s.Media != null) |
1913 | row["Media"] = s.Media.ToXml(); | 1911 | row["Media"] = s.Media.ToXml(); |
1914 | } | 1912 | } |
@@ -2246,7 +2244,6 @@ namespace OpenSim.Data.SQLite | |||
2246 | delete.Parameters.Add(createSqliteParameter("AccessUUID", typeof(String))); | 2244 | delete.Parameters.Add(createSqliteParameter("AccessUUID", typeof(String))); |
2247 | da.DeleteCommand = delete; | 2245 | da.DeleteCommand = delete; |
2248 | da.DeleteCommand.Connection = conn; | 2246 | da.DeleteCommand.Connection = conn; |
2249 | |||
2250 | } | 2247 | } |
2251 | 2248 | ||
2252 | private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn) | 2249 | private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn) |
@@ -2318,7 +2315,7 @@ namespace OpenSim.Data.SQLite | |||
2318 | return DbType.String; | 2315 | return DbType.String; |
2319 | } | 2316 | } |
2320 | } | 2317 | } |
2321 | 2318 | ||
2322 | static void PrintDataSet(DataSet ds) | 2319 | static void PrintDataSet(DataSet ds) |
2323 | { | 2320 | { |
2324 | // Print out any name and extended properties. | 2321 | // Print out any name and extended properties. |
diff --git a/OpenSim/Data/Tests/BasicDataServiceTest.cs b/OpenSim/Data/Tests/BasicDataServiceTest.cs index 272a2ca..7d85f0c 100644 --- a/OpenSim/Data/Tests/BasicDataServiceTest.cs +++ b/OpenSim/Data/Tests/BasicDataServiceTest.cs | |||
@@ -68,13 +68,13 @@ namespace OpenSim.Data.Tests | |||
68 | { | 68 | { |
69 | m_connStr = !String.IsNullOrEmpty(conn) ? conn : DefaultTestConns.Get(typeof(TConn)); | 69 | m_connStr = !String.IsNullOrEmpty(conn) ? conn : DefaultTestConns.Get(typeof(TConn)); |
70 | 70 | ||
71 | m_log = LogManager.GetLogger(this.GetType()); | 71 | m_log = LogManager.GetLogger(this.GetType()); |
72 | OpenSim.Tests.Common.TestLogging.LogToConsole(); // TODO: Is that right? | 72 | OpenSim.Tests.Common.TestLogging.LogToConsole(); // TODO: Is that right? |
73 | } | 73 | } |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// To be overridden in derived classes. Do whatever init with the m_service, like setting the conn string to it. | 76 | /// To be overridden in derived classes. Do whatever init with the m_service, like setting the conn string to it. |
77 | /// You'd probably want to to cast the 'service' to a more specific type and store it in a member var. | 77 | /// You'd probably want to to cast the 'service' to a more specific type and store it in a member var. |
78 | /// This framework takes care of disposing it, if it's disposable. | 78 | /// This framework takes care of disposing it, if it's disposable. |
79 | /// </summary> | 79 | /// </summary> |
80 | /// <param name="service">The service being tested</param> | 80 | /// <param name="service">The service being tested</param> |
@@ -145,12 +145,12 @@ namespace OpenSim.Data.Tests | |||
145 | { | 145 | { |
146 | if (m_service != null) | 146 | if (m_service != null) |
147 | { | 147 | { |
148 | if( m_service is IDisposable) | 148 | if (m_service is IDisposable) |
149 | ((IDisposable)m_service).Dispose(); | 149 | ((IDisposable)m_service).Dispose(); |
150 | m_service = null; | 150 | m_service = null; |
151 | } | 151 | } |
152 | 152 | ||
153 | if( !String.IsNullOrEmpty(m_file) && File.Exists(m_file) ) | 153 | if (!String.IsNullOrEmpty(m_file) && File.Exists(m_file)) |
154 | File.Delete(m_file); | 154 | File.Delete(m_file); |
155 | } | 155 | } |
156 | 156 | ||
@@ -231,7 +231,7 @@ namespace OpenSim.Data.Tests | |||
231 | lst += ", " + s; | 231 | lst += ", " + s; |
232 | } | 232 | } |
233 | 233 | ||
234 | string sCond = stores.Length > 1 ? ("in (" + lst + ")") : ("=" + lst); | 234 | string sCond = stores.Length > 1 ? ("in (" + lst + ")") : ("=" + lst); |
235 | try | 235 | try |
236 | { | 236 | { |
237 | ExecuteSql("DELETE FROM migrations where name " + sCond); | 237 | ExecuteSql("DELETE FROM migrations where name " + sCond); |