During an automatic upgrade to 4.2.2 I am getting a blank screen on upgrading the database and the following error in the php.log:

[Mon Jun 29 08:48:10 2015] [error] [client] PHP Fatal error:  
Call to undefined method wpdb::get_col_length() in 
on line 1461, 
referer: http://example.com/wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F

The public front of the site works fine but I cannot login to the admin area without it trying to run the database upgrade and giving me a blank screen.

Trying a manual upgrade does not fix the problem. Things are stuck in a loop trying to upgrade the database and not being able to find wpdb::get_col_length() in the functions included into the upgrade code.


I checked in mysql and the type of the column it was looking for is text and in version 5.1 of MySQL that I am using the size is 65,535 so I replaced line 1461 which was giving error with the following hardcoded size:

        $content_length = array(
                        'type'   => 'byte',
                        'length' => 65535,

After that the upgrade completed fine and the site is healthy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.