NivixX / NDatabase

💾 NDatabase is a lightweight and easy to use indexed key-value store database framework mainly aimed for minecraft bukkit, spigot, sponge servers and is multi-platform
MIT License
57 stars 2 forks source link

Issues on index creation #14

Open HappyAreaBean opened 7 months ago

HappyAreaBean commented 7 months ago

Hi, I have some issues when using MySQL, here is my entity.

MySQL 5.7.44

Click here for Error

```java [18:58:17 ERROR]: Error occurred while enabling SimpleJoinMessage v1.2.0-SNAPSHOT-5972ed9 (Is it up to date?) sjm.libs.nivixx.database.ndatabase.api.exception.DatabaseCreationException: Error during index creation by de-normalization for NEntity cc.happyareabean.sjm.database.SJMData at sjm.libs.nivixx.database.ndatabase.core.dao.jdbc.JdbcDao.createIndexes(JdbcDao.java:250) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] at sjm.libs.nivixx.database.ndatabase.core.RepositoryManager.getOrCreateRepository(RepositoryManager.java:58) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] at sjm.libs.nivixx.database.ndatabase.core.NDatabaseAPIImpl.getOrCreateRepository(NDatabaseAPIImpl.java:19) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] at cc.happyareabean.sjm.database.DatabaseManager.(DatabaseManager.java:42) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] at cc.happyareabean.sjm.SimpleJoinMessage.loadDatabase(SimpleJoinMessage.java:111) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] at cc.happyareabean.sjm.SimpleJoinMessage.onEnable(SimpleJoinMessage.java:77) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:287) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:188) ~[paper-1.20.4.jar:git-Paper-493] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.4.jar:git-Paper-493] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.4.jar:git-Paper-493] at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.4.jar:git-Paper-493] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:671) ~[paper-1.20.4.jar:git-Paper-493] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431) ~[paper-1.20.4.jar:git-Paper-493] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:309) ~[paper-1.20.4.jar:git-Paper-493] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1131) ~[paper-1.20.4.jar:git-Paper-493] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.20.4.jar:git-Paper-493] at java.lang.Thread.run(Thread.java:833) ~[?:?] Caused by: 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 'IF NOT EXISTS collection_name_index ON sjm_data(collection_name)' at line 1 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121) ~[mysql-connector-j-8.2.0.jar:8.2.0] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-j-8.2.0.jar:8.2.0] at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:912) ~[mysql-connector-j-8.2.0.jar:8.2.0] at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:354) ~[mysql-connector-j-8.2.0.jar:8.2.0] at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] at sjm.libs.nivixx.database.ndatabase.core.dao.jdbc.JdbcDao.denormalizeFieldIntoColumn(JdbcDao.java:283) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] at sjm.libs.nivixx.database.ndatabase.core.dao.jdbc.JdbcDao.createIndexes(JdbcDao.java:246) ~[SimpleJoinMessage-1.2.0-SNAPSHOT.jar:?] ... 17 more [18:58:17 INFO]: [SimpleJoinMessage] Disabling SimpleJoinMessage v1.2.0-SNAPSHOT-5972ed9 Caused by: 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 'IF NOT EXISTS collection_name_index ON sjm_data(collection_name)' at line 1 ```


MariaDB 10.6.16

Click here for Error

```java Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '{4}))' at line 1 ```

NivixX commented 7 months ago

Hello, thank you for reporting the issue with details.

I will write an adapter for Mysql 5.7 <= and then for mariaDB

HappyAreaBean commented 7 months ago

Hello! Thank you for the update! MySQL seems to be working well right now. But I still have the same error with MariaDB.