Scavenger3 / Essentials-SignCommands

tShock Plugin
10 stars 20 forks source link

SetMyHome updating, improper MySQL syntax #2

Closed ColinBohn closed 12 years ago

ColinBohn commented 12 years ago

In setmyhome updating a previous entry in MySQL for a database returns an error.

2012-05-24 00:10:28 - Command: ERROR: MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' WorldID = 130848201' at line 1 at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()

This is caused by incorrect syntax. The plugin sends the command: UPDATE EssentialsUserHomes SET HomeX = 4204, HomeY = 718 WHERE UserID = 2, WorldID = 130848201 But should instead send: UPDATE EssentialsUserHomes SET HomeX = 4204, HomeY = 718 WHERE UserID = 2 AND WorldID = 130848201

It's possible this is an error with the TShock SQLTableEditor, and not the plugin itself. Either way though, it's a bug that I figured should be reported.

ColinBohn commented 12 years ago

I just looked further into it and the syntax is defined by TShock's database manager, not your plugin, so it's not a problem at your end of the code.

Scavenger3 commented 12 years ago

Hey! Thanks for reporting this issue, I've fixed it in v1.2.8 by creating my own database (should have done it this way in the first place). Check the changelog in the wiki for more info!