-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
⚠ SQLibrary 7.1 no longer functions on newer Paper builds #3948
Comments
Probably because they bumped mysql-connector-java from 5.x to 8.x to fix various security vulnerabilities. See PatPeter/SQLibrary#25 for a similar bump that's not merged. "If SQLibrary is deprecated, what replaced it?" nothing basically. There is some plugin probably providing similar hooks but Skript used SQLibrary for years, and the non-CSV databases in Skript right now are currently not in a good state too - most users use CSV so that's the most common and tested, stable configuration. I recommend not using SQL/MySQL with Skript until a revamp of the database system is made, or such. For this specific issue though, As it does not use the data source but only loads it (seen from here https://github.com/PatPeter/SQLibrary/blob/master/src/main/java/lib/PatPeter/SQLibrary/MySQL.java#L133 - it is commented out!) and uses traditional way of DriverManager, thankly no code changes needed there, and as it is a constant string, you can also do this from Jar String Editor. Here is a version I modified (not tested): SQLibrary-7.1-jse-modified-cj-jdbc.zip You can also do it yourself and you can also modify world guard error messages and such with this site, without recompiling, forking, using git, gradle, maven, etc. it is simple and you can replace any constant string without ever messing with bytecode or recompilation manually. As on "what can be done on Paper's or Skript's side" - Paper can create a backwards compatibility class named com.mysql.jdbc.jdbc2.optional.MysqlDataSource and redirect it to jdbc3/4 generic packages which is com.mysql.cj.jdbc.MysqlDataSource in 8.x after rename and com.mysql.jdbc.MysqlDataSource in some versions. Though that will only allow connecting, if the code is written with JDBC 5.x specific implementation details in mind other errors may occur. Plugins need updating probably. As for what can be done Skript side, the same, but Paper doing it will be better since if Skript does that that class would probably cause duplicate classes on all versions that has 5.x driver (i.e Spigot, older Paper builds, older Paper MC releases, etc.) For the Paper PR causing this see PaperMC/Paper#5474 , scroll down a bit and you'll see all the linked issues that this PR did break. This why testing is important. Even if it is a good change, there should be prior deprecation warnings and such. Not an instant removal/upgrade to major versions of dependencies used by plugins.. Not a fan of that PR. Maybe Skript can switch to https://github.com/aikar/db - developed by aikar, this plugin also break with that PR but someone made a PR to fix it and it merged quickly. So it is still developed at least and made by aikar. |
I remember some time ago there was a discussion about changing the database skript used from csv to something else, does anyone remember what it was? |
See #1168 |
It worked! I love uuuu |
Pinning so users can view this for possible solutions until Skript has a proper SQL system. See the following for a modern experiment download to a Skript version to soon be implemented #5646 |
Description
As of Paper build #587 some MySQL elements have changed, requiring some sort of class update for anything that uses MySQL.
Because of this, as of that build MySQL databases cannot be used by Skript.
Steps to Reproduce
Paper build #587+
Skript + SQLibrary 7.1 no longer connects to a MySQL Database
Reverting to Paper build #586 still operates fine.
Errors
[13:02:25 WARN]: [Skript][MySQL] MySQL DataSource class missing: com.mysql.jdbc.jdbc2.optional.MysqlDataSource.
[13:02:25 ERROR]: #!#!
[13:02:25 ERROR]: #!#! ===!!!=== Skript variable load error ===!!!===
[13:02:25 ERROR]: #!#! Unable to load (all) variables:
[13:02:25 ERROR]: #!#! Cannot connect to the database 'MySQL database'! Please make sure that all settings are correct and that the database software is running.
[13:02:25 ERROR]: #!#!
[13:02:25 ERROR]: #!#! Skript will work properly, but old variables might not be available at all and new ones may or may not be saved until Skript is able to create a backup of the old file and/or is able to connect to the database (which requires a restart of Skript)!
[13:02:25 ERROR]: #!#!
Server Information
Paper build Latest (or any build past #587)
Minecraft 1.16.5
Comments
I keep thinking there's a more "modern" solution to storing Skript variables in an SQL database, but my months of searching continually come up empty. If SQLibrary is depreciated, what replaced it?
The text was updated successfully, but these errors were encountered: