Add filters for install/upgrade queries, so that unit tests installer can force creating InnoDB tables, so that we can use transactions to revert the database to its initial state after each test. See #17749

git-svn-id: http://svn.automattic.com/wordpress/trunk@18531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nbachiyski 2011-08-11 04:42:59 +00:00
parent c8721d2600
commit 4870176ad0
1 changed files with 3 additions and 0 deletions

View File

@ -1382,6 +1382,7 @@ function dbDelta($queries, $execute = true) {
$queries = explode( ';', $queries );
if ('' == $queries[count($queries) - 1]) array_pop($queries);
}
$queries = apply_filters( 'dbdelta_queries', $queries );
$cqueries = array(); // Creation Queries
$iqueries = array(); // Insertion Queries
@ -1402,6 +1403,8 @@ function dbDelta($queries, $execute = true) {
// Unrecognized query type
}
}
$cqueries = apply_filters( 'dbdelta_create_queries', $cqueries );
$iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );
// Check to see which tables and fields exist
if ($tables = $wpdb->get_col('SHOW TABLES;')) {