Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#30097 closed defect (bug) (fixed)

Unnecessary wildcard query when upgrading sites on a network

Reported by: jeremyfelt Owned by: jeremyfelt
Priority: normal Milestone: 4.1
Component: Networks and Sites Version:
Severity: normal Keywords: good-first-bug has-patch
Cc: Focuses: multisite

Description

From #24922

In wp-admin/network/upgrade.php, we use SELECT * FROM rather than SELECT blog_id FROM, even though blog_id is the only field used after the query.

Attachments (1)

30097.patch (740 bytes ) - added by marcosf 12 years ago.

Download all attachments as: .zip

Change History (4)

@marcosf
12 years ago

#1 @marcosf
12 years ago

  • Keywords has-patch added; needs-patch removed

I've changed the "SELECT *" to "SELECT blog_id" and tested the upgrade. The upgrade was working fine after applying the patch/change. I also double checked and did not find anything else that's needed by the upgrade script besides the blog id.

#2 @jeremyfelt
12 years ago

  • Milestone Future Release4.1
  • Owner set to jeremyfelt
  • Status newaccepted

Thanks for the patch @marcosf! I tested this as well and everything's working properly.

Two tips for future patches - create the patch file from the repository root as this makes it easier to apply. Also, watch the diff for any change in whitespace.

#3 @jeremyfelt
12 years ago

  • Resolutionfixed
  • Status acceptedclosed

In 30029:

Optimize site query when performing network database upgrades

We only use blog_id from the query, so we don't need a wildcard.

props marcosf
Fixes #30097

Note: See TracTickets for help on using tickets.