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: https://develop.svn.wordpress.org/trunk@18531 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Nikolay Bachiyski 2011-08-11 04:42:59 +00:00
parent f228bf94cf
commit c5b4e06e15
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;')) {