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

Caught exception when rolling back a DELTA_CHEST #58

Open
Albuca opened this issue Apr 8, 2011 · 1 comment
Open

Caught exception when rolling back a DELTA_CHEST #58

Albuca opened this issue Apr 8, 2011 · 1 comment
Milestone

Comments

@Albuca
Copy link

Albuca commented Apr 8, 2011

When editing the contents of a chest, and then rolling back those changes, the following exception occurs.
BB #291
CB #612

2011-04-08 16:10:30 [SEVERE] [BBROTHER] Rollback edit SQL Exception
org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "UPDATE  BBDATA AS BBDATA,[*]    BBUSERS AS USR  SET RBACKED = '1' WHERE  BBDATA.PLAYER = USR.ID AND ACTION IN('0','1','4','12','2','13','15','16','17','19','20') AND USR.NAME IN ('Albuca') AND DATE > '1302278907' AND X < '500' AND X > '490' AND Y < '90' AND Y > '80' AND Z < '529' AND Z > '519' AND WORLD = '0' AND WORLD = '0' AND RBACKED = '0'; "; expected "SET"; SQL statement:
UPDATE  bbdata AS bbdata, bbusers AS usr  SET rbacked = '1' WHERE  bbdata.player = usr.id AND action IN('0','1','4','12','2','13','15','16','17','19','20') AND usr.name IN ('Albuca') AND date > '1302278907' AND x < '500' AND x > '490' AND y < '90' AND y > '80' AND z < '529' AND z > '519' AND world = '0' AND world = '0' AND rbacked = '0'; [42001-153]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.getSyntaxError(DbException.java:192)
at org.h2.command.Parser.read(Parser.java:2737)
at org.h2.command.Parser.parseUpdate(Parser.java:658)
at org.h2.command.Parser.parsePrepared(Parser.java:423)
at org.h2.command.Parser.parse(Parser.java:275)
at org.h2.command.Parser.parse(Parser.java:247)
at org.h2.command.Parser.prepare(Parser.java:201)
at org.h2.command.Parser.prepareCommand(Parser.java:214)
at org.h2.engine.Session.prepareLocal(Session.java:426)
at org.h2.engine.Session.prepareCommand(Session.java:374)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1100)
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:71)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:243)
at me.taylorkelly.bigbrother.rollback.Rollback$Rollbacker.run(Rollback.java:200)
2011-04-08 16:10:30 [WARNING] [BBROTHER] Caught exception when rolling back a DELTA_CHEST
2011-04-08 16:10:30 [WARNING] [BBROTHER] Caught exception when rolling back a DELTA_CHEST
2011-04-08 16:10:30 [WARNING] [BBROTHER] Caught exception when rolling back a DELTA_CHEST
@frozen707
Copy link

I found the issue, in /src/main/java/me/taylorkelly/bigbrother/datasource/DataBlockSender.java (line 79 at commit 7d18cf5), apparently the author decided to crop the data-field to 150 characters in commit fd39862, for a "connection bug fix". This causes a problem every time for DELTA_CHEST because it always saves EVERY slot when a change occurs, if only the changed slots would be saved, the problem would be at least only occur on big changes, but at present it requires 174 characters AT MINIMUM. which causes it to crash at the parser stage when reverting.
Also, for some reason the table contains a lot of amount-entries starting with +- and then a number, but when reading the source for the roll-back parser, this seems to be unexpected?

Edit:
You can apparently increase the maximum allowed statement size by passing "maxAllowedPacket=??M" (this defaults to the server default, which in turn defaults to 1 megabyte) to the "jdbc:mysql://" connect string (as seen in http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html), the connector probably cannot fragment the statement itself, but leaves that for the network stack to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants