I’ve updated to the new version of MySql (5.7.20) on ubuntu and it causes the following error:
[FONT=‘Courier New’]>> Applying update “2017_10_27_01_world.sql” ‘BDDAB16’…
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1067 (42000) at line 181: Invalid default value for ‘start_time’[/FONT]
Line 181 of the mentioned update is
[FONT=‘Courier New’]ALTER TABLE
game_event ADD COLUMN
holidayStage TINYINT UNSIGNED NOT NULL DEFAULT ‘0’ AFTER
however it only indirectly causes the world server startup error. The problem mysql is talking about is in the table [FONT=‘Courier New’]game_event[/FONT] the two columns [FONT=‘Courier New’]start_time [/FONT]and [FONT=‘Courier New’]end_time[/FONT] have a default value of ‘0000-00-00 00:00:00’
however in the mysql documentation it is clearly states that the range of Type [FONT=‘Courier New’]timestamp[/FONT] is between 1970-01-01 and 2038-01-19
therefore the default value is out of range, which causes the error. I’m not sure why mysql allowed setting this default value in the first place or why it is only noticed now by it but it has to do with the new version of mysql 5.7.20 since it went unnoticed by previous versions.
Fixing the problem:
Changing the default value of the two defective columns to the minimum allowed value sadly only results in another error since multiple rows in [FONT=‘Courier New’]game_event[/FONT] already have faulty [FONT=‘Courier New’]start_time[/FONT] and [FONT=‘Courier New’]end_time[/FONT] values. Only changing both fixes the error and the world server start normally.
The attached sql file fixes the problem and also corrects a minor typo of the comment of [FONT=‘Courier New’]end_time[/FONT] “[…]aflter.” → “[…]after.”