From: Aaron Schulz Date: Sun, 3 Feb 2013 11:10:34 +0000 (-0800) Subject: [Database] Set bytea_output to match pg_unescape_bytea(). X-Git-Tag: 1.31.0-rc.0~20688 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=af08c2a9bff3a78998881735c729e33d3ebe88c2;p=lhc%2Fweb%2Fwiklou.git [Database] Set bytea_output to match pg_unescape_bytea(). * In newer versions of PG, a "hex" escaping format is used, which totally breaks things like SqlBagOStuff since the pg_unescape_bytea function still works the old way (it does not use a DB handle). Setting the format to the old way via SET fixes this. Change-Id: I9f5a64922acd2d954880790f42ba4efafaed314e --- diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 5049ecf52e..2cbcc4b277 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -393,6 +393,9 @@ class DatabasePostgres extends DatabaseBase { $this->query( "SET datestyle = 'ISO, YMD'", __METHOD__ ); $this->query( "SET timezone = 'GMT'", __METHOD__ ); $this->query( "SET standard_conforming_strings = on", __METHOD__ ); + if ( $this->getServerVersion() >= 9.0 ) { + $this->query( "SET bytea_output = 'escape'", __METHOD__ ); // PHP bug 53127 + } global $wgDBmwschema; $this->determineCoreSchema( $wgDBmwschema );