ks-hl / AuxProtect

Data Logging and Inventory Recovery plugin designed to suplement CoreProtect
25 stars 8 forks source link

MySQL query error when migrating/creating new table #2

Closed NeadApTar closed 1 year ago

NeadApTar commented 1 year ago

MySQL Ver - 8.0.30-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

Paste column with name blob in `.

stmt = "CREATE TABLE IF NOT EXISTS " + Table.AUXPROTECT_INVBLOB.toString();
stmt += " (time BIGINT(255), `blob` MEDIUMBLOB);";
[21:33:54 WARN]: [AuxProtect] 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 'blob MEDIUMBLOB)' at line 1
java.sql.SQLSyntaxErrorException: 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 'blob MEDIUMBLOB)' at line 1
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:763) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at dev.heliosares.auxprotect.database.SQLManager.execute(SQLManager.java:387) ~[AuxProtect.jar:?]
        at dev.heliosares.auxprotect.database.SQLManager.init(SQLManager.java:247) ~[AuxProtect.jar:?]
        at dev.heliosares.auxprotect.database.SQLManager.connect(SQLManager.java:147) ~[AuxProtect.jar:?]
        at dev.heliosares.auxprotect.spigot.AuxProtectSpigot$1.run(AuxProtectSpigot.java:160) ~[AuxProtect.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[pufferfish-1.19.2.jar:git-Pufferfish-38]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[pufferfish-1.19.2.jar:git-Pufferfish-38]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[pufferfish-1.19.2.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
ks-hl commented 1 year ago

Thanks for the detailed report. Try this

NeadApTar commented 1 year ago

Everything is working now

ks-hl commented 1 year ago

Great!

NeadApTar commented 1 year ago

@Heliosares Add everywhere in queries, because

[17:11:48 WARN]: [AuxProtect] 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 'blob) VALUES 
(1665238308473, _binary'??\0w\0\0\0sr\0org.bukkit.util.io.Wrap' at line 1
java.sql.SQLSyntaxErrorException: 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 'blob) VALUES 
(1665238308473, _binary'??\0w\0\0\0sr\0org.bukkit.util.io.Wrap' at line 1
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:916) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1009) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1320) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:994) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at dev.heliosares.auxprotect.database.SQLManager.putBlobs_(SQLManager.java:589) ~[AuxProtect.jar:?]
        at dev.heliosares.auxprotect.database.SQLManager.putBlobs(SQLManager.java:565) ~[AuxProtect.jar:?]
        at dev.heliosares.auxprotect.database.SQLManager.put(SQLManager.java:503) ~[AuxProtect.jar:?]
        at dev.heliosares.auxprotect.database.DatabaseRunnable.run(DatabaseRunnable.java:129) ~[AuxProtect.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[matter-1.19.2.jar:git-Matter-19]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[matter-1.19.2.jar:git-Matter-19]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[matter-1.19.2.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
ks-hl commented 1 year ago

I've done some more thorough testing now... This should work. https://github.com/Heliosares/AuxProtect/releases/tag/1.1.7.2