From e3bcea79c7a7024d4862e64943565c67c53877c0 Mon Sep 17 00:00:00 2001 From: Christopher Date: Thu, 9 Jul 2020 00:27:41 +0200 Subject: [PATCH] use static table name --- src/Storage/MySQL.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Storage/MySQL.cs b/src/Storage/MySQL.cs index 55919a4..bc3bbf2 100644 --- a/src/Storage/MySQL.cs +++ b/src/Storage/MySQL.cs @@ -52,8 +52,7 @@ namespace OpenSim.Modules.DataValue.Storage { using (MySqlCommand _mysqlCommand = m_mySQLClient.CreateCommand()) { - _mysqlCommand.CommandText = "Select StorageID, StorageKey FROM ?mysqlTable WHERE StorageID = ?mysqlStorage AND StorageKey = ?mysqlStorageKey"; - _mysqlCommand.Parameters.AddWithValue("?mysqlTable", "StorageData"); + _mysqlCommand.CommandText = "Select StorageID, StorageKey FROM StorageData WHERE StorageID = ?mysqlStorage AND StorageKey = ?mysqlStorageKey"; _mysqlCommand.Parameters.AddWithValue("?mysqlStorage", storageID); _mysqlCommand.Parameters.AddWithValue("?mysqlStorageKey", key); @@ -71,8 +70,7 @@ namespace OpenSim.Modules.DataValue.Storage { using (MySqlCommand _mysqlCommand = m_mySQLClient.CreateCommand()) { - _mysqlCommand.CommandText = "Select StorageID, StorageKey, StorageData FROM ?mysqlTable WHERE StorageID = ?mysqlStorage AND StorageKey = ?mysqlStorageKey"; - _mysqlCommand.Parameters.AddWithValue("?mysqlTable", "StorageData"); + _mysqlCommand.CommandText = "Select StorageID, StorageKey, StorageData FROM StorageData WHERE StorageID = ?mysqlStorage AND StorageKey = ?mysqlStorageKey"; _mysqlCommand.Parameters.AddWithValue("?mysqlStorage", storageID); _mysqlCommand.Parameters.AddWithValue("?mysqlStorageKey", key); @@ -90,8 +88,7 @@ namespace OpenSim.Modules.DataValue.Storage { using (MySqlCommand _mysqlCommand = m_mySQLClient.CreateCommand()) { - _mysqlCommand.CommandText = "DELETE FROM ?mysqlTable WHERE StorageID = ?mysqlStorage AND StorageKey = ?mysqlStorageKey"; - _mysqlCommand.Parameters.AddWithValue("?mysqlTable", "StorageData"); + _mysqlCommand.CommandText = "DELETE FROM StorageData WHERE StorageID = ?mysqlStorage AND StorageKey = ?mysqlStorageKey"; _mysqlCommand.Parameters.AddWithValue("?mysqlStorage", storageID); _mysqlCommand.Parameters.AddWithValue("?mysqlStorageKey", key); _mysqlCommand.ExecuteNonQuery(); @@ -102,8 +99,7 @@ namespace OpenSim.Modules.DataValue.Storage { using (MySqlCommand _mysqlCommand = m_mySQLClient.CreateCommand()) { - _mysqlCommand.CommandText = "REPLACE INTO ?mysqlTable (StorageID, StorageKey, StorageData) VALUES (?mysqlStorage, ?mysqlStorageKey, ?mysqlStorageData)"; - _mysqlCommand.Parameters.AddWithValue("?mysqlTable", "StorageData"); + _mysqlCommand.CommandText = "REPLACE INTO StorageData (StorageID, StorageKey, StorageData) VALUES (?mysqlStorage, ?mysqlStorageKey, ?mysqlStorageData)"; _mysqlCommand.Parameters.AddWithValue("?mysqlStorage", storageID); _mysqlCommand.Parameters.AddWithValue("?mysqlStorageKey", key); _mysqlCommand.Parameters.AddWithValue("?mysqlStorageData", data);