Ticket #15332: 15332.patch
| File 15332.patch, 2.0 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/includes/upgrade.php
2041 2041 2042 2042 $cqueries = array(); // Creation Queries 2043 2043 $iqueries = array(); // Insertion Queries 2044 $vqueries = array(); // View Queries 2044 2045 $for_update = array(); 2045 2046 2046 2047 // Create a tablename index for an array ($cqueries) of queries … … 2054 2055 $iqueries[] = $qry; 2055 2056 } elseif ( preg_match( "|UPDATE ([^ ]*)|", $qry, $matches ) ) { 2056 2057 $iqueries[] = $qry; 2058 } elseif ( preg_match( "|CREATE VIEW ([^ ]*)|", $qry, $matches ) ) { 2059 $vqueries[] = $qry; 2060 } elseif ( preg_match( "|CREATE ALGORITHM([^ ]*)|", $qry, $matches ) ) { 2061 $vqueries[] = $qry; 2062 } elseif ( preg_match( "|CREATE OR REPLACE VIEW ([^ ]*)|", $qry, $matches ) ) { 2063 $vqueries[] = $qry; 2064 } elseif ( preg_match( "|CREATE OR REPLACE ALGORITHM([^ ]*)|", $qry, $matches ) ) { 2065 $vqueries[] = $qry; 2057 2066 } else { 2058 2067 // Unrecognized query type 2059 2068 } … … 2081 2090 */ 2082 2091 $iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries ); 2083 2092 2093 /** 2094 * Filter the dbDelta SQL queries for creating or replacing views. 2095 * 2096 * Queries filterable via this hook contain "CREATE VIEW" or "CREATE OR REPLACE VIEW". 2097 * 2098 * @since x.x.x 2099 * 2100 * @param array $iqueries An array of dbDelta insert or update SQL queries. 2101 */ 2102 $vqueries = apply_filters( 'dbdelta_iview_queries', $vqueries ); 2103 2084 2104 $global_tables = $wpdb->tables( 'global' ); 2085 2105 foreach ( $cqueries as $table => $qry ) { 2086 2106 // Upgrade global tables only for the main site. Don't upgrade at all if conditions are not optimal. … … 2257 2277 unset( $cqueries[ $table ], $for_update[ $table ] ); 2258 2278 } 2259 2279 2260 $allqueries = array_merge($cqueries, $iqueries); 2280 foreach( $vqueries as $table => $query ) { 2281 $for_update[] = $query; 2282 } 2283 2284 $allqueries = array_merge($cqueries, $iqueries, $vqueries); 2261 2285 if ($execute) { 2262 2286 foreach ($allqueries as $query) { 2263 2287 // todo: Remove this?