use static table name

master
Christopher 2020-07-09 00:27:41 +02:00
parent 5736143dc5
commit e3bcea79c7
1 changed files with 4 additions and 8 deletions

View File

@ -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);