WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11443 closed defect (bug) (fixed)

Unnecessary has_cap checks for MySQL 4.1

Reported by: filosofo Owned by: ryan
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Database Keywords: has_cap wpdb has-patch
Focuses: Cc:

Description

Now that we're using MySQL 4.1 as a minimum requirement, we don't have to do wpdb capability checks for its features.

Patch removes checks.

Attachments (1)

remove_mysql_4.1_has_cap.11443.diff (4.0 KB) - added by filosofo 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 filosofo4 years ago

  • Keywords has-patch added

comment:2 ryan4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [12409]) Remove no longer needed DB has_cap() checks. Props filosofo. fixes #11443

comment:3 follow-ups: westi4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I am a bit wary of doing this this close to release.

While we require the mysql version for our wp-db class a drop in replacement class could be being used which doesn't have these caps.

I wonder whether we should be making this change at this point in the cycle.

Can we not leave taking this out till 3.0?

comment:4 ryan4 years ago

I doubt any of the drop-ins have the limitations our old MySQL requirement did, but point taken.

comment:5 ryan4 years ago

Drop-ins have to update with every release of WP anyway. Removing has_cap() checks that probably only have relevance to ancient MySQL versions probably won't affect them any more than the new SQL added to 2.9 will (such as ON DUPLICATE KEY UPDATE).

comment:6 filosofo4 years ago

For what it's worth, there are only 2 has_cap checks relevant to wpdb drop-ins (in wp-includes/query.php), and they both use what I believe is pretty standard SQL subquery syntax.

comment:7 in reply to: ↑ 3 Denis-de-Bernardy4 years ago

Replying to westi:

Can we not leave taking this out till 3.0?

I initially had the same thought when reading this ticket :-)

Then again...

While we require the mysql version for our wp-db class a drop in replacement class could be being used which doesn't have these caps.

In this case the recently introduced on duplicate key statement won't work either, meaning they won't be able to update options. Also, aren't we save to assume that anyone who is savvy enough to install a drop in replacement class of wpdb is also a) savvy enough to be using MySQL 5.1 or b) (see #10918) savvy enough to fix their query translator accordingly?

comment:8 follow-up: ryan4 years ago

Indeed. I almost punted this but thought removing the cap checks would make us most consistent given the introduction of ON DUPLICATE. Any breakage that occurs from this could be a good thing because it would forcibly remind drop-in authors to update. I don't feel strongly either way, however.

comment:9 in reply to: ↑ 8 westi4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Replying to ryan:

Indeed. I almost punted this but thought removing the cap checks would make us most consistent given the introduction of ON DUPLICATE. Any breakage that occurs from this could be a good thing because it would forcibly remind drop-in authors to update. I don't feel strongly either way, however.

It is good to remind them to update.

Lets leave these changes in for now and just hi-light in the RC and Release announcements the new minimum mysql version requirement.

comment:10 in reply to: ↑ 3 miqrogroove4 years ago

Replying to westi:

I am a bit wary of doing this this close to release.

Good intuition. see #11666

Note: See TracTickets for help on using tickets.