From 488a7f46aa08e03f98346cab6f51116d90f5b400 Mon Sep 17 00:00:00 2001 From: Mike Dickson Date: Sat, 5 Aug 2023 16:42:36 -0400 Subject: [PATCH 1/2] Fix an issue with profile fetching query where its passing a UUID down to the query incorrectly. Did an exhaustive search of all the statements building queries and found 2 more unhandled cases which I also fixed. Bumped the version number to 8617 --- OpenSim/Data/MySQL/MySQLInventoryData.cs | 2 +- OpenSim/Data/MySQL/MySQLUserProfilesData.cs | 6 +++--- OpenSim/Framework/VersionInfo.cs | 2 +- .../OpenSim.Data.MySQL.MoneyData/MySQLMoneyManager.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 963fda91acf..51c2223267c 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -494,7 +494,7 @@ public void addInventoryItem(InventoryItemBase item) result.Parameters.AddWithValue("?salePrice", item.SalePrice); result.Parameters.AddWithValue("?saleType", unchecked((sbyte)item.SaleType)); result.Parameters.AddWithValue("?creationDate", item.CreationDate); - result.Parameters.AddWithValue("?groupID", item.GroupID); + result.Parameters.AddWithValue("?groupID", item.GroupID.ToString()); result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); result.Parameters.AddWithValue("?flags", item.Flags); diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs index 3cbe5f4d4ae..c4330091da6 100644 --- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs +++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs @@ -93,7 +93,7 @@ public OSDArray GetClassifiedRecords(UUID creatorId) dbcon.Open(); using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) { - cmd.Parameters.AddWithValue("?Id", creatorId); + cmd.Parameters.AddWithValue("?Id", creatorId.ToString()); using( MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.Default)) { if(reader.HasRows) @@ -142,8 +142,8 @@ public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result) + "`simname`," + "`posglobal`," + "`parcelname`," - + "`classifiedflags`," - + "`priceforlisting`) " + + "`classifiedflags`," + + "`priceforlisting`) " + "VALUES (" + "?ClassifiedId," + "?CreatorId," diff --git a/OpenSim/Framework/VersionInfo.cs b/OpenSim/Framework/VersionInfo.cs index 38bfeae6a4d..e7ef41eb807 100644 --- a/OpenSim/Framework/VersionInfo.cs +++ b/OpenSim/Framework/VersionInfo.cs @@ -39,7 +39,7 @@ public class VersionInfo { public const string VersionNumber = "0.9.2.2"; public const string AssemblyVersionNumber = "0.9.2.2"; - public const string Release = "8615"; + public const string Release = "8617"; public const Flavour VERSION_FLAVOUR = Flavour.Dev; diff --git a/addon-modules/OpenSim.Data.MySQL.MoneyData/OpenSim.Data.MySQL.MoneyData/MySQLMoneyManager.cs b/addon-modules/OpenSim.Data.MySQL.MoneyData/OpenSim.Data.MySQL.MoneyData/MySQLMoneyManager.cs index f166b755fe9..9bc8543d397 100644 --- a/addon-modules/OpenSim.Data.MySQL.MoneyData/OpenSim.Data.MySQL.MoneyData/MySQLMoneyManager.cs +++ b/addon-modules/OpenSim.Data.MySQL.MoneyData/OpenSim.Data.MySQL.MoneyData/MySQLMoneyManager.cs @@ -1392,7 +1392,7 @@ public bool updateTransactionStatus(UUID transactionID, int status, string descr MySqlCommand cmd = new MySqlCommand(sql, dbcon); cmd.Parameters.AddWithValue("?status", status); cmd.Parameters.AddWithValue("?desc", description); - cmd.Parameters.AddWithValue("?tranid", transactionID); + cmd.Parameters.AddWithValue("?tranid", transactionID.ToString()); if (cmd.ExecuteNonQuery() > 0) bRet = true; From e3f6b40c8b975d39d677f995e9dc08419c831284 Mon Sep 17 00:00:00 2001 From: Mike Dickson Date: Mon, 7 Aug 2023 17:28:20 -0400 Subject: [PATCH 2/2] Fix for exception when reading classifieds in the profile module. Category is a varchar string in the database but was treated as an int. Changed the code to call System.Convert.ToInt32 which will handle an object and convert correctly regardless of the table type. This way the same code should work on core or on a database where the database Category has been migrated to an int. Bumped version to 8619 --- OpenSim/Data/MySQL/MySQLUserProfilesData.cs | 2 +- OpenSim/Framework/VersionInfo.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs index c4330091da6..05f33368a8b 100644 --- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs +++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs @@ -288,7 +288,7 @@ public bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result) ad.ExpirationDate = Convert.ToInt32(reader["expirationdate"]); ad.ParentEstate = Convert.ToInt32(reader["parentestate"]); ad.Flags = (byte)reader.GetUInt32("classifiedflags"); - ad.Category = reader.GetInt32("category"); + ad.Category = Convert.ToInt32(reader["category"]); ad.Price = reader.GetInt16("priceforlisting"); ad.Name = reader.GetString("name"); ad.Description = reader.GetString("description"); diff --git a/OpenSim/Framework/VersionInfo.cs b/OpenSim/Framework/VersionInfo.cs index e7ef41eb807..e5b85474cb2 100644 --- a/OpenSim/Framework/VersionInfo.cs +++ b/OpenSim/Framework/VersionInfo.cs @@ -39,7 +39,7 @@ public class VersionInfo { public const string VersionNumber = "0.9.2.2"; public const string AssemblyVersionNumber = "0.9.2.2"; - public const string Release = "8617"; + public const string Release = "8619"; public const Flavour VERSION_FLAVOUR = Flavour.Dev;