Skip to content

Commit

Permalink
Fix ban system conversion issue with MySQL
Browse files Browse the repository at this point in the history
DeathCradle spotted a typo in the ban converter and identified that the
issue is likely because we used table_name in some, but not all, of the
conversion SQL.

Co-authored-by: DeathCradle <rt.luke.s@gmail.com>
  • Loading branch information
hakusaro and SignatureBeef committed Apr 11, 2021
1 parent b862baa commit c8e6f32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
## Upcoming changes
* This could be you!

## TShock 4.5.1
* Fixed typo in conversion from old to new ban system for MySQL hosted ban databases. (@DeathCradle)

## TShock 4.5.0
* Updated OTAPI and TSAPI to Terraria 1.4.2.1. (@Stealownz, @DeathCradle)
* Updated TShock with preliminary protocol support for Terraria 1.4.2.1. (@Stealownz)
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/BanManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void TryConvertBans()
int res;
if (database.GetSqlType() == SqlType.Mysql)
{
res = database.QueryScalar<int>("SELECT COUNT(name) FROM information_schema.tables WHERE table_schema = @0 and table_name = 'Bans'", TShock.Config.Settings.MySqlDbName);
res = database.QueryScalar<int>("SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema = @0 and table_name = 'Bans'", TShock.Config.Settings.MySqlDbName);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions TShockAPI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ You should have received a copy of the GNU General Public License
// Also, be sure to release on github with the exact assembly version tag as below
// so that the update manager works correctly (via the Github releases api and mimic)

[assembly: AssemblyVersion("4.5.0")]
[assembly: AssemblyFileVersion("4.5.0")]
[assembly: AssemblyVersion("4.5.1")]
[assembly: AssemblyFileVersion("4.5.1")]

0 comments on commit c8e6f32

Please sign in to comment.