L2JMobius

Free Users => Solved/Invalid Bug Reports => Topic started by: maximov on July 31, 2019, 12:55:04 PM

Title: Problem in sql-need help.
Post by: maximov on July 31, 2019, 12:55:04 PM
Good day! After you create the clan starts rattling off error in the GS log.
Table clan_privs empty. How to fix?

org.l2jmobius.gameserver.model.clan.Clan restoreRankPrivs
SEVERE: Error restoring clan privs by rank: (conn=1365) 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 ',party FROM clan_privs WHERE clan_id=268495965' at line 1
java.sql.SQLSyntaxErrorException: (conn=1365) 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 ',party FROM clan_privs WHERE clan_id=268495965' at line 1
   at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:236)
   at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:165)
   at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:238)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:232)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:174)
   at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
   at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
   at org.l2jmobius.gameserver.model.clan.Clan.restoreRankPrivs(Clan.java:1981)
   at org.l2jmobius.gameserver.model.clan.Clan.restore(Clan.java:1127)
   at org.l2jmobius.gameserver.model.clan.Clan.<init>(Clan.java:172)
   at org.l2jmobius.gameserver.data.sql.impl.ClanTable.<init>(ClanTable.java:100)
   at org.l2jmobius.gameserver.data.sql.impl.ClanTable$SingletonHolder.<clinit>(ClanTable.java:541)
   at org.l2jmobius.gameserver.data.sql.impl.ClanTable.getInstance(ClanTable.java:536)
   at org.l2jmobius.gameserver.GameServer.<init>(GameServer.java:282)
   at org.l2jmobius.gameserver.GameServer.main(GameServer.java:488)
Caused by: java.sql.SQLException: 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 ',party FROM clan_privs WHERE clan_id=268495965' at line 1
Query is: SELECT privs,rank,party FROM clan_privs WHERE clan_id=?, parameters [268495965]
java thread: main
   at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:163)
   at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:280)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:223)
   ... 12 more
Title: Re: Problem in sql-need help.
Post by: Liamxroy on July 31, 2019, 01:49:14 PM
Good day! After you create the clan starts rattling off error in the GS log.
Table clan_privs empty. How to fix?

org.l2jmobius.gameserver.model.clan.Clan restoreRankPrivs
SEVERE: Error restoring clan privs by rank: (conn=1365) 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 ',party FROM clan_privs WHERE clan_id=268495965' at line 1
java.sql.SQLSyntaxErrorException: (conn=1365) 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 ',party FROM clan_privs WHERE clan_id=268495965' at line 1
   at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:236)
   at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:165)
   at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:238)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:232)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:174)
   at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
   at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
   at org.l2jmobius.gameserver.model.clan.Clan.restoreRankPrivs(Clan.java:1981)
   at org.l2jmobius.gameserver.model.clan.Clan.restore(Clan.java:1127)
   at org.l2jmobius.gameserver.model.clan.Clan.<init>(Clan.java:172)
   at org.l2jmobius.gameserver.data.sql.impl.ClanTable.<init>(ClanTable.java:100)
   at org.l2jmobius.gameserver.data.sql.impl.ClanTable$SingletonHolder.<clinit>(ClanTable.java:541)
   at org.l2jmobius.gameserver.data.sql.impl.ClanTable.getInstance(ClanTable.java:536)
   at org.l2jmobius.gameserver.GameServer.<init>(GameServer.java:282)
   at org.l2jmobius.gameserver.GameServer.main(GameServer.java:488)
Caused by: java.sql.SQLException: 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 ',party FROM clan_privs WHERE clan_id=268495965' at line 1
Query is: SELECT privs,rank,party FROM clan_privs WHERE clan_id=?, parameters [268495965]
java thread: main
   at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:163)
   at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:280)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:223)
   ... 12 more

Did you change anything in clan table by hand ?
Title: Re: Problem in sql-need help.
Post by: Mobius on July 31, 2019, 02:17:27 PM
When did this happen?
Title: Re: Problem in sql-need help.
Post by: maximov on July 31, 2019, 06:30:32 PM
Through the admin panel I raised the level of the clan. I didn't change anything else.
(https://downloader.disk.yandex.ru/preview/889b58b22bbd931822d382da77d55edc5d9ec21d2bc5e624a98d21db4efbf9f6/5d41ecda/HkTBknsCiejtdYkZclKcY5wC9vPiSy2kfwNikTrMz9ChNo-2Oqi2Xs6Efpe5pm2HiFTfbnbFoyRFBjvZSVy5Jw%3D%3D?uid=0&filename=Screenshot_21.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&owner_uid=0&tknv=v2&size=2048x2048)
Title: Re: Problem in sql-need help.
Post by: Mobius on July 31, 2019, 06:38:01 PM
What you expect to find there?
Title: Re: Problem in sql-need help.
Post by: maximov on July 31, 2019, 07:06:35 PM
The error points to this table. It's empty. I expect nothing. I just want to make it right.

Query is: SELECT privs,rank,party FROM clan_privs WHERE clan_id=?, parameters [268495965]

Selection from an empty table. If I understand correctly.

(https://downloader.disk.yandex.ru/preview/4ca9f7ca91fbd377c2f018267c840ee2e9afa422ec968e4d4965b0adeb8aac59/5d41fcfa/nazIqRXbSxkhFD-aUrPTeTWmORB6CqsXSb_iyqv8SBd3kE-494kCj6bu-wGndngqWZPFzK2m0uh_Z_rrtwsyVw%3D%3D?uid=0&filename=Screenshot_22.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&owner_uid=0&tknv=v2&size=2048x2048)
Title: Re: Problem in sql-need help.
Post by: maximov on July 31, 2019, 07:56:34 PM
The error is related to granting privileges. You give privileges. and they are not recorded in the database.
Title: Re: Problem in sql-need help.
Post by: Mobius on July 31, 2019, 08:03:33 PM
Try this.
https://pastebin.com/npM35JfU
Title: Re: Problem in sql-need help.
Post by: Mobius on July 31, 2019, 08:06:33 PM
Patch updated.
Title: Re: Problem in sql-need help.
Post by: Mobius on July 31, 2019, 08:12:08 PM
Also try this.
https://pastebin.com/XEPrdhch
Title: Re: Problem in sql-need help.
Post by: maximov on July 31, 2019, 08:17:41 PM
Could not store clan privs for rank: (conn=2486) Parameter at position 5 is not set
java.sql.SQLException: (conn=2486) Parameter at position 5 is not set
Title: Re: Problem in sql-need help.
Post by: Mobius on July 31, 2019, 08:18:24 PM
Try the updated patch.
Or the latest.
Title: Re: Problem in sql-need help.
Post by: ReynalDev on July 31, 2019, 11:36:14 PM
If you using MariaDB, rank could be interpreted like keyword, but this happen since MariaDB 10.2.
https://mariadb.com/kb/en/library/rank/
Title: Re: Problem in sql-need help.
Post by: GMavenging on August 01, 2019, 12:48:39 AM
Good day! After you create the clan starts rattling off error in the GS log.
Table clan_privs empty. How to fix?

org.l2jmobius.gameserver.model.clan.Clan restoreRankPrivs
SEVERE: Error restoring clan privs by rank: (conn=1365) 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 ',party FROM clan_privs WHERE clan_id=268495965' at line 1
java.sql.SQLSyntaxErrorException: (conn=1365) 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 ',party FROM clan_privs WHERE clan_id=268495965' at line 1
   at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:236)
   at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:165)
   at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:238)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:232)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:159)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:174)
   at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
   at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
   at org.l2jmobius.gameserver.model.clan.Clan.restoreRankPrivs(Clan.java:1981)
   at org.l2jmobius.gameserver.model.clan.Clan.restore(Clan.java:1127)
   at org.l2jmobius.gameserver.model.clan.Clan.<init>(Clan.java:172)
   at org.l2jmobius.gameserver.data.sql.impl.ClanTable.<init>(ClanTable.java:100)
   at org.l2jmobius.gameserver.data.sql.impl.ClanTable$SingletonHolder.<clinit>(ClanTable.java:541)
   at org.l2jmobius.gameserver.data.sql.impl.ClanTable.getInstance(ClanTable.java:536)
   at org.l2jmobius.gameserver.GameServer.<init>(GameServer.java:282)
   at org.l2jmobius.gameserver.GameServer.main(GameServer.java:488)
Caused by: java.sql.SQLException: 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 ',party FROM clan_privs WHERE clan_id=268495965' at line 1
Query is: SELECT privs,rank,party FROM clan_privs WHERE clan_id=?, parameters [268495965]
java thread: main
   at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:163)
   at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:280)
   at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:223)
   ... 12 more

Did you change anything in clan table by hand ?

that only happens with mysql 8, tested in maria DB 10 and without errors
Title: Re: Problem in sql-need help.
Post by: GMavenging on August 01, 2019, 12:49:41 AM
also the query does not produce any error in game
Title: Re: Problem in sql-need help.
Post by: maximov on August 01, 2019, 02:48:22 AM
Put everything on MariaDB. The GS error is gone. But privileges don't work. Put the privileges of the main clan, and they are not saved.
Title: Re: Problem in sql-need help.
Post by: maximov on August 01, 2019, 01:25:02 PM
Rights were saved in the table clan_privs after reboot. But in the game after the clan action window with the clan becoming inactive. This is a small problem, but still a bug.
Until
(https://downloader.disk.yandex.ru/preview/61b0bcd40f8aee490922478e8aa9f49e27c25cfe2cc9b44e4872829a26bef256/5d42f54f/peTUb26MRLpEbj4havXwPClZn0vBn2i0_A-U4IYOsAfEIjbjJQSMDtNCFjQwKpEBUZ2yML2vGY-OC2hEZIDLLA%3D%3D?uid=0&filename=Screenshot_34.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&owner_uid=0&tknv=v2&size=2048x2048)
after
(https://downloader.disk.yandex.ru/preview/efcde4b406c2ff5c5bb9800f3a726e6c5c7e87dce3263e343fcc9517a8d15951/5d42f5db/NNY1K5W9VbtuIa8sJ-38pbdBeUjC2hiMgPfuZhXTaRj1IClqABrKVVnHAMVFuMxRhTOnMOLYznzBqGa7IPUJnQ%3D%3D?uid=0&filename=Screenshot_35.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&owner_uid=0&tknv=v2&size=2048x2048)
(https://downloader.disk.yandex.ru/preview/b4760899dd18108a502d31740ea8f129729cfac6c0590baea158a9fa5506c0cd/5d42f61f/G56IpujKUODcpLSlRANoaG2qv40zrLu00uBiAdoVBfe5oClLCUwUxi58aaXyNC0MDjQNtSn7wjR4uRqoS4noBA%3D%3D?uid=0&filename=Screenshot_37.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&owner_uid=0&tknv=v2&size=2048x2048)
Title: Re: Problem in sql-need help.
Post by: Mobius on August 10, 2019, 02:11:49 AM
https://dev.mysql.com/doc/refman/8.0/en/keywords.html
RANK (R); added in 8.0.2 (reserved)

Add rank in single quotes in query.

Fixed with revision 5769.