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

SQL exception on UPDATE HELP Plz #46

Closed
Ageo opened this issue Dec 7, 2011 · 5 comments
Closed

SQL exception on UPDATE HELP Plz #46

Ageo opened this issue Dec 7, 2011 · 5 comments

Comments

@Ageo
Copy link

Ageo commented Dec 7, 2011

2011-12-07 17:42:56 [SEVERE] [LogBlock Consumer] SQL exception on UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323276173), lastlogin)) WHERE playerid = 548;:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'onlinetime' cannot be null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
at com.mysql.jdbc.Util.getInstance(Util.java:382)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2570)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:779)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:622)
at de.diddiz.LogBlock.Consumer.run(Consumer.java:276)
at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
at java.lang.Thread.run(Thread.java:636)

All the time with 1.3 and 1.4 ...

how i can fix that plz? i dont understand what is this bug
I'm not an hard user for SQL :/

craftbukkit 1337
logblock 1.4.1

Thx dude !

@DiddiZ
Copy link
Member

DiddiZ commented Dec 7, 2011

Either disable online time logging fully by setting loggin.playerInfo in LB main config to false, or if you need it, check the online time column if there is a null:
SELECT onlinetime FROM lb-players WHERE playerid = 548;

@Ageo
Copy link
Author

Ageo commented Dec 7, 2011

logPlayerInfo: true This in false ?
My Online time column is null on lb-player,
This command don't work: #1064 - 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 '-players WHERE playerid = 548 LIMIT 0, 30' at line 1

Thx you Diddiz !

@Ageo
Copy link
Author

Ageo commented Dec 7, 2011

2011-12-07 22:23:08 [INFO] [LogBlock] Permissions plugin found.
2011-12-07 22:23:08 [INFO] [LogBlock] Found 1 imports.
2011-12-07 22:23:08 [INFO] [LogBlock] Trying to import queue-1323292982265-0.sql ...
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 4;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 668;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 781;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 751;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 646;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 812;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 427;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 19;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [INFO] [LogBlock] Scheduled consumer with bukkit scheduler.
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 26;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 709;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [WARNING] [LogBlock] Error while importing: 'UPDATE lb-players SET onlinetime = ADDTIME(onlinetime, TIMEDIFF(FROM_UNIXTIME(1323292982), lastlogin)) WHERE playerid = 24;': Column 'onlinetime' cannot be null
2011-12-07 22:23:08 [INFO] [LogBlock] Successfully imported queue-1323292982265-0.sql.
2011-12-07 22:23:08 [INFO] [LogBlock] Successfully imported stored queue. (0 rows imported, 11 errors)
2011-12-07 22:23:08 [INFO] LogBlock v1.41 by DiddiZ enabled.

@DiddiZ
Copy link
Member

DiddiZ commented Dec 7, 2011

SELECT onlinetime FROM lb-players WHERE playerid = 548;

Yes, set it to false.

Or, just one shot in the dark, try:
UPDATE lb-players SET onlinetime = '00:00:00' WHERE onlinetime = NULL;

@Ageo
Copy link
Author

Ageo commented Dec 8, 2011

It's ok, very thx for you'r help and rapidity !

@DiddiZ DiddiZ closed this as completed Dec 8, 2011
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