Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

special characters breaking simpleclans MySQL connection #461

Open
TomLewis opened this issue Mar 15, 2025 · 3 comments
Open

special characters breaking simpleclans MySQL connection #461

TomLewis opened this issue Mar 15, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@TomLewis
Copy link
Contributor

Describe the bug
We had a player report they lost their balance from their crew, when I inspected the logs, I saw this crypic mysql error from simpleclans, scrolling up I see a player with this weird tag for thier clan;
[SimpleClans] [ἄνουβις] Aslifecrawls » it gives extra armor and health

I presume those special characters are breaking saving into the MySQL table for the Database Encoding?
https://gist.github.com/TomLewis/a02d6e0099b72a8e5344bf191e23423c

I put this error into ChatGPT and it asked me to check the schema should be utf8mb4 but its latin1

SELECT schema_name, default_character_set_name, default_collation_name 
FROM information_schema.schemata 
WHERE schema_name = 'databaseName';

It suggests to do;

ALTER TABLE `sc_players` MODIFY `flags` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sc_clans` MODIFY `ranks` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Should I do this, is it safe? would this solve the issue?

To Reproduce
Steps to reproduce the behavior:

  1. use weird characters in clan name/tag
  2. use mysql
  3. See error

Software (please complete the following information):

  • Server: PurPur 1.18.2
  • Plugin version 2.19.3-snapshot
@TomLewis TomLewis added the bug Something isn't working label Mar 15, 2025
@RoinujNosde
Copy link
Owner

Not sure if those queries are correct, can't check now.

But this is a known issue, there's a suggested config here:
https://wiki.roinujnosde.me/simpleclans/other/known-issues#mysql-1366-incorrect-string-value

@TomLewis
Copy link
Contributor Author

Aha perfect, thats the same answer then, using utf8mb4 encoding. I made my SimpleClans tables so many years ago, the encoding may be different for freshly generated tables to be utf8mb4, it looks like the AI is specifying just those errors its been sent, maybe its worthwhile doing it across all of SimpleClans tables, I dont think I want to mess around with global mysql if I can just tell the tables to be the correct encoding.

if not what other colums would be good to update too?

@RoinujNosde
Copy link
Owner

if not what other colums would be good to update too?

columns that accept user input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants