From af08c2a9bff3a78998881735c729e33d3ebe88c2 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 3 Feb 2013 03:10:34 -0800 Subject: [PATCH] [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 --- includes/db/DatabasePostgres.php | 3 +++ 1 file changed, 3 insertions(+) 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 ); -- 2.20.1