[wp-trac] [WordPress Trac] #4027: upgrade.php doesn't detect that ALTER TABLE fails

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 25 12:58:51 GMT 2007


#4027: upgrade.php doesn't detect that ALTER TABLE fails
----------------------------+-----------------------------------------------
 Reporter:  skjaeve         |       Owner:  anonymous
     Type:  defect          |      Status:  new      
 Priority:  low             |   Milestone:  2.3      
Component:  Administration  |     Version:  2.1.2    
 Severity:  normal          |    Keywords:           
----------------------------+-----------------------------------------------
 When I upgraded from 2.0.5 to 2.1.2, there was an error in my MySQL
 privileges, so the ALTER TABLE commands failed:

 {{{
     WordPress database error: [ALTER command denied to user
 'aasmunds'@'localhost' for table 'wp_categories']
     ALTER TABLE wp_categories ADD COLUMN link_count bigint(20) NOT NULL
 default '0'

     WordPress database error: [ALTER command denied to user
 'aasmunds'@'localhost' for table 'wp_categories']
     ALTER TABLE wp_categories ADD COLUMN posts_private tinyint(1) NOT NULL
 default '0'

     WordPress database error: [ALTER command denied to user
 'aasmunds'@'localhost' for table 'wp_categories']
     ALTER TABLE wp_categories ADD COLUMN links_private tinyint(1) NOT NULL
 default '0'
 }}}

 There were also a lot of secondary errors due to the above failed
 commands. However, the upgrade.php script still claimed that all was well:

 {{{
 There's actually only one step. So if you see this, you're done. Have fun!
 }}}

 It would be more helpful if WP would detect the MySQL errors and actually
 say that something went wrong and must be fixed, instead of saying that
 all is well even though there were heaps of errors.

 This only happens once: If I run the upgrade.php script again, it just
 says 'all is well' without any errors, so the MySQL commands that would
 fail are not run again. However, the database is still broken.

 It would be better if WP discovered that an upgrade failed, and set a flag
 somewhere that said 'this upgrade must be run again'.

 See also http://wordpress.org/support/topic/111398?replies=2

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4027>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list