public
Last active

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 protections against data truncation

  • Download Gist
wp-db.php.patch
Diff
1 2 3 4 5 6 7 8 9 10
--- 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);
}
/**

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.)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.