Aperture-Development / MSync-2

Version 2 of MSync - Fully working and extra steak
https://www.Aperture-Development.de
GNU General Public License v3.0
12 stars 1 forks source link

Data too long for column 'rank' at row 1 #59

Closed KKonaOG closed 4 years ago

KKonaOG commented 4 years ago

Description Attempting to use the name "communitymanager" for a rank in MSync gives you a data too long for column 'rank'.

Reproduction Add a rank to the sync system with the name "communitymanager"

Error Messages

------------------------------------
[MRSync] SQL Error!
------------------------------------
Please include this in a Bug report:

Data too long for column 'rank' at row 1

------------------------------------

I believe this is just a varchar sizing issue, would it be possible to increase the size limit? I believe I could fix this manually myself, however, I felt it prudent to report things like this so you are aware.

ApertureDevelopment commented 4 years ago

With database engineering its important to keep in mind what the maximum reasonable colum lenght should be, and in this case I decided that 15 letters should be more then enough. I can increase the limit to 20, but I suggest to use shorter rank names instead.

KKonaOG commented 4 years ago

With database engineering its important to keep in mind what the maximum reasonable colum lenght should be, and in this case I decided that 15 letters should be more then enough. I can increase the limit to 20, but I suggest to use shorter rank names instead.

20 should definitely do it, but you should also probably put a catch for rank entry into MSync 2 to prevent too many characters, rather than simply having it error out in the console because some server owners will not be aware of that situation.

ApertureDevelopment commented 4 years ago

ALTER TABLE `msync_dev`.`tbl_mrsync` CHANGE COLUMN `rank` `rank` VARCHAR(20) NOT NULL ;

You can use that to alter your MRSync database, but I am not going to raise the limit by default.

But for your other idea of the soft error instead of the hard one, that will be added to the MSync 1.3 milestone