[wpmu-trac] Re: [WordPress MU Trac] #669: Better DB cleanup when deleting blogs.

WordPress MU Trac wpmu-trac at lists.automattic.com
Wed Jul 2 01:44:02 GMT 2008


#669: Better DB cleanup when deleting blogs.
------------------------+---------------------------------------------------
 Reporter:  lunabyte    |        Owner:  somebody
     Type:  defect      |       Status:  new     
 Priority:  normal      |    Milestone:          
Component:  component1  |      Version:          
 Severity:  normal      |   Resolution:          
 Keywords:  db cleanup  |  
------------------------+---------------------------------------------------
Comment (by jamescollins):

 Good idea Lunabyte.

 Replying to [ticket:669 lunabyte]:
 >               $drop_tables = $wpdb->get_results("show tables LIKE '".
 $wpdb->base_prefix . $blog_id . "%'", ARRAY_A);

 However I think that the LIKE query would cause problems.

 For example, in the case where we were deleting blog id 4 and there were
 100 blogs, the like query would also try and delete tables for blog ids 40
 - 49.

 Perhaps this LIKE query should be used instead (ie add the underscore
 before the %)?

                 $drop_tables = $wpdb->get_results("show tables LIKE '".
 $wpdb->base_prefix . $blog_id . "_%'", ARRAY_A);

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/669#comment:1>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list