Make WordPress Core

Opened 2 years ago

Closed 22 months ago

#24912 closed enhancement (duplicate)

patch allowing wordpress to function normally on mysql strict servers

Reported by: WebDragon Owned by:
Milestone: Priority: normal
Severity: major Version: 3.5.2
Component: Database Keywords: has-patch
Focuses: Cc:


when the server is configured with sql-mode='ANSI,TRADITIONAL,ONLY_FULL_GROUP_BY', installation and operation of wordpress fails, as it has not yet been modified to run in a strict environment.

This one-line patch to wp-db.php allows wordpress to function normally as it would on a default mysql install where strict is NOT enabled by default (we won't debate the merits of this horrifying decision by mysql developers)

you can preview it as a gist here: https://gist.github.com/WebDragon/6066884

and additionally I will attach it as a .patch

I've tested it here on my local system and all seems well (since it would die horribly otherwise)

Please consider adding this to core as a workaround for strict servers until such time as wordpress can be rewritten to function in a strict environment.

Attachments (1)

wp-db.php.patch (279 bytes) - added by WebDragon 2 years ago.
patch for wp-includes/wp-db.php

Download all attachments as: .zip

Change History (7)

2 years ago

patch for wp-includes/wp-db.php

#1 @markoheijnen
2 years ago

It's to late for 3.6 so I think we should first check which queries can be fixed when running mysql in a strict environment.

#2 @ocean90
2 years ago

Duplicate/Related: #16697, #14978, #8857

#3 @esmi
2 years ago

FYI, Percona ships with a tighter configuration than "standard" MySQL. In this instance, the installation may run without any apparent problems and the resultant site appears to be fine. The issues may only come to light when trying to view tag or category pages when the query returns zero results. This has been documented in http://wordpress.org/support/topic/unable-to-view-posts-by-categorys-or-tags (fresh, vanilla install of 3.6).

#4 @WebDragon
2 years ago

Would still like to see this patch applied to current wordpress, if nothing else in lieu of a full switch-over to ability to run in a strict mysql environment as outlined above

This same patch applied cleanly to 3.6/3.7/3.8 installation, so the applicable version number can be bumped

#5 @morgantocker
22 months ago

Should be merged with #26847.

#6 @nacin
22 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #26847.

Note: See TracTickets for help on using tickets.