Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@WebDragon
Last active December 20, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WebDragon/6066884 to your computer and use it in GitHub Desktop.
Save WebDragon/6066884 to your computer and use it in GitHub Desktop.
patch wp-includes/wp-db.php on a mysql server that is set up to normally run as SQL_MODE="ANSI,TRADITIONAL,ONLY_FULL_GROUP_BY" -- which wordpress currently barfs all over because it has not yet been reconfigured to run on a strict server, so that this way, wordpress will function as it normally would on a default mysql server with no strictness …
--- wp-includes/wp-db.php 2013-06-21 14:41:52.000000000 -0400
+++ wp-includes/wp-db.php 2013-07-23 18:37:01.298896949 -0400
@@ -1166,6 +1166,7 @@
$this->ready = true;
$this->select( $this->dbname, $this->dbh );
+ mysql_query( "SET sql_mode=''", $this->dbh);
}
/**
@WebDragon
Copy link
Author

The problem has now been fixed in wordpress core (insofar, at least, as a similar workaround -- not ACTUALLY by making wordpress able to function properly in a strict environment) with a bit more detail than my simple patch https://core.trac.wordpress.org/ticket/26847 due to how mysql 5.6 ships with more strictness on by default (good for them! about time, too.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment