aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-19 18:09:10 +0000
committerJustin Clarke Casey2009-02-19 18:09:10 +0000
commit07609565617aa7936758acba5fd625877564a10d (patch)
tree73123e37f14fea5f171cbe04753c21758f25afc1 /OpenSim/Data/MSSQL/MSSQLInventoryData.cs
parent* Okay, so finally got my head around this. Problem is that upstream Prebuild... (diff)
downloadopensim-SC-07609565617aa7936758acba5fd625877564a10d.zip
opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.gz
opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.bz2
opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=3142
* Changes varchar(36) columns to UUID type in MSSQL - this will be much more efficient * ===As always, please, please backup your database before applying this patch=== * Thanks Ruud Lathrop (for the patch) and StrawberryFride (for the review)
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLInventoryData.cs')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLInventoryData.cs22
1 files changed, 11 insertions, 11 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
index f367d78..4e7e322 100644
--- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
@@ -317,7 +317,7 @@ namespace OpenSim.Data.MSSQL
317 List<InventoryFolderBase> subFolders; 317 List<InventoryFolderBase> subFolders;
318 using (SqlCommand command = new SqlCommand("SELECT * FROM inventoryfolders WHERE parentFolderID = @parentID", connection)) 318 using (SqlCommand command = new SqlCommand("SELECT * FROM inventoryfolders WHERE parentFolderID = @parentID", connection))
319 { 319 {
320 command.Parameters.Add(database.CreateParameter("@parentID", string.Empty)); 320 command.Parameters.Add(database.CreateParameter("@parentID", UUID.Zero));
321 321
322 AutoClosingSqlCommand autoCommand = new AutoClosingSqlCommand(command); 322 AutoClosingSqlCommand autoCommand = new AutoClosingSqlCommand(command);
323 323
@@ -589,7 +589,7 @@ namespace OpenSim.Data.MSSQL
589 /// <returns></returns> 589 /// <returns></returns>
590 private static List<InventoryFolderBase> getFolderHierarchy(UUID parentID, AutoClosingSqlCommand command) 590 private static List<InventoryFolderBase> getFolderHierarchy(UUID parentID, AutoClosingSqlCommand command)
591 { 591 {
592 command.Parameters["@parentID"].Value = parentID.ToString(); 592 command.Parameters["@parentID"].Value = parentID.Guid; //.ToString();
593 593
594 List<InventoryFolderBase> folders = getInventoryFolders(command); 594 List<InventoryFolderBase> folders = getInventoryFolders(command);
595 595
@@ -663,9 +663,9 @@ namespace OpenSim.Data.MSSQL
663 try 663 try
664 { 664 {
665 InventoryFolderBase folder = new InventoryFolderBase(); 665 InventoryFolderBase folder = new InventoryFolderBase();
666 folder.Owner = new UUID((string)reader["agentID"]); 666 folder.Owner = new UUID((Guid)reader["agentID"]);
667 folder.ParentID = new UUID((string)reader["parentFolderID"]); 667 folder.ParentID = new UUID((Guid)reader["parentFolderID"]);
668 folder.ID = new UUID((string)reader["folderID"]); 668 folder.ID = new UUID((Guid)reader["folderID"]);
669 folder.Name = (string)reader["folderName"]; 669 folder.Name = (string)reader["folderName"];
670 folder.Type = (short)reader["type"]; 670 folder.Type = (short)reader["type"];
671 folder.Version = Convert.ToUInt16(reader["version"]); 671 folder.Version = Convert.ToUInt16(reader["version"]);
@@ -691,24 +691,24 @@ namespace OpenSim.Data.MSSQL
691 { 691 {
692 InventoryItemBase item = new InventoryItemBase(); 692 InventoryItemBase item = new InventoryItemBase();
693 693
694 item.ID = new UUID(reader["inventoryID"].ToString()); 694 item.ID = new UUID((Guid)reader["inventoryID"]);
695 item.AssetID = new UUID(reader["assetID"].ToString()); 695 item.AssetID = new UUID((Guid)reader["assetID"]);
696 item.AssetType = Convert.ToInt32(reader["assetType"].ToString()); 696 item.AssetType = Convert.ToInt32(reader["assetType"].ToString());
697 item.Folder = new UUID(reader["parentFolderID"].ToString()); 697 item.Folder = new UUID((Guid)reader["parentFolderID"]);
698 item.Owner = new UUID(reader["avatarID"].ToString()); 698 item.Owner = new UUID((Guid)reader["avatarID"]);
699 item.Name = reader["inventoryName"].ToString(); 699 item.Name = reader["inventoryName"].ToString();
700 item.Description = reader["inventoryDescription"].ToString(); 700 item.Description = reader["inventoryDescription"].ToString();
701 item.NextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"]); 701 item.NextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"]);
702 item.CurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"]); 702 item.CurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"]);
703 item.InvType = Convert.ToInt32(reader["invType"].ToString()); 703 item.InvType = Convert.ToInt32(reader["invType"].ToString());
704 item.Creator = new UUID(reader["creatorID"].ToString()); 704 item.Creator = new UUID((Guid)reader["creatorID"]);
705 item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]); 705 item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]);
706 item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]); 706 item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]);
707 item.GroupPermissions = Convert.ToUInt32(reader["inventoryGroupPermissions"]); 707 item.GroupPermissions = Convert.ToUInt32(reader["inventoryGroupPermissions"]);
708 item.SalePrice = Convert.ToInt32(reader["salePrice"]); 708 item.SalePrice = Convert.ToInt32(reader["salePrice"]);
709 item.SaleType = Convert.ToByte(reader["saleType"]); 709 item.SaleType = Convert.ToByte(reader["saleType"]);
710 item.CreationDate = Convert.ToInt32(reader["creationDate"]); 710 item.CreationDate = Convert.ToInt32(reader["creationDate"]);
711 item.GroupID = new UUID(reader["groupID"].ToString()); 711 item.GroupID = new UUID((Guid)reader["groupID"]);
712 item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); 712 item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
713 item.Flags = Convert.ToUInt32(reader["flags"]); 713 item.Flags = Convert.ToUInt32(reader["flags"]);
714 714