Jump to content
AlexHeylin

FIX: maintenancemode view - stop it generating warnings and outputting incorrect data

Recommended Posts

The maintenancemode table has been replaced with a view which emulates the data the maintenancemode table used to contain by building it from the new maintenancemodequeue table.  However CW screwed up the SQL because instead of using a stock MySQL function they tried to calculate some time / datetime values themselves.  With long-lasting maintenance modes this can overflow the maximum value for a time datatype which causes the SQL to throw warnings and produce incorrect output. 

Here's a fix - submitted to CW as Ticket#13557433 on 2020-070-02

You'll likely need to replace this after every upgrade / patch until CW get around to fixing the code in their releases.  I wouldn't hold your breath - last time it took two years for them to replace their broken SQL with the fix I gave them. 

Note - I have not confirmed that the output of this table matches what would have existed in the old maintenancemode table under all conditions.  Instead I have focused on just fixing the calculations CW used.

To use either directly run / import the direct-import file below, or open the view in your SQL editor and paste the view-content file into the view and click save.

 

maintenancemode-fixed-2020-07-02-direct-import.sql maintenancemode-fixed-2020-07-02-view-content.sql

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...