Skip to content
This repository has been archived by the owner on Mar 11, 2018. It is now read-only.

Commit

Permalink
put brackets in the right place, genius
Browse files Browse the repository at this point in the history
(cherry picked from commit 99acccbd60a3c7b2934e23fbaa4770908f0a5fff)
  • Loading branch information
ibroadfo committed Nov 19, 2013
1 parent 64ff79e commit c295b49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions wp-admin/includes/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,15 @@ function populate_options() {
a.option_name NOT LIKE '\_transient\_timeout\_%' AND
b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) )
AND b.option_value < $time RETURNING b.option_id)
DELETE FROM wp_options WHERE option_id in (select option_id from bx))";
DELETE FROM wp_options WHERE option_id in (select option_id from bx)");

if ( is_main_site() && is_main_network() ) {
$wpdb->query("WITH bx AS (DELETE FROM $wpdb->options a USING $wpdb->options b WHERE
a.option_name LIKE '\_site\_transient\_%' AND
a.option_name NOT LIKE '\_site\_transient\_timeout\_%' AND
b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) )
AND b.option_value < $time RETURNING b.option_id)
DELETE FROM wp_options WHERE option_id in (select option_id from bx))";
DELETE FROM wp_options WHERE option_id in (select option_id from bx)");
}
}

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ function upgrade_network() {
a.meta_key NOT LIKE '\_site\_transient\_timeout\_%' AND
b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, 17 ) )
AND b.meta_value < $time RETURNING b.option_id)
DELETE FROM wp_options WHERE option_id in (select option_id from bx))";
DELETE FROM wp_options WHERE option_id in (select option_id from bx)");
}

// 2.8
Expand Down

0 comments on commit c295b49

Please sign in to comment.