[wp-unit-tests] [WordPress Unit Tests] #139: Blogs are created using MyISAM with no transaction support

WordPress Trac noreply at wordpress.org
Fri Nov 9 21:18:35 UTC 2012


#139: Blogs are created using MyISAM with no transaction support
--------------------------+-----------------------
 Reporter:  inderpreet99  |       Type:  defect
   Status:  new           |   Priority:  normal
Milestone:                |  Component:  Multisite
 Keywords:  has-patch     |
--------------------------+-----------------------
 I've been using wp-unit-tests to test multisite. I've noticed that the
 single install tables are created properly as INNODB (due to the code in
 bin/install.php). Yet the tables created by $this->factory->blog->create()
 produces tables in the default engine (which is MyISAM for MySQL <5.5).
 And mysql transactions do not work in MyISAM.

 Problem: There is no call to set the database storage_engine in wp-
 admin/includes/schema.php or wp-unit-tests for blog creation.

 Possible solution: Add a call in WP_UnitTestCase::setUp() after
 $wpdb->db_connect(), like so:
 {{{
 #!php
 // blogs are created in default engine (could be MyISAM for MySQL <5.5)
 $wpdb->query( 'SET storage_engine = INNODB' );
 }}}

-- 
Ticket URL: <http://unit-tests.trac.wordpress.org/ticket/139>
WordPress Unit Tests <http://unit-tests.trac.wordpress.org>
My example project


More information about the wp-unit-tests mailing list