Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#24912 closed enhancement (duplicate)

patch allowing wordpress to function normally on mysql strict servers

Reported by: webdragon's profile 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:

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 11 years ago.
patch for wp-includes/wp-db.php

Download all attachments as: .zip

Change History (7)

11 years ago

patch for wp-includes/wp-db.php

#1 @markoheijnen
11 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
11 years ago

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

#3 @esmi
11 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 (fresh, vanilla install of 3.6).

#4 @WebDragon
11 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
10 years ago

Should be merged with #26847.

#6 @nacin
10 years 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.