revert r99562 and set standard_conforming_strings “on” by default
authorMark A. Hershberger <mah@users.mediawiki.org>
Tue, 18 Oct 2011 21:09:52 +0000 (21:09 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Tue, 18 Oct 2011 21:09:52 +0000 (21:09 +0000)
includes/db/DatabasePostgres.php

index 1b0539c..8974dc8 100644 (file)
@@ -200,6 +200,7 @@ class DatabasePostgres extends DatabaseBase {
                $this->query( "SET client_encoding='UTF8'", __METHOD__ );
                $this->query( "SET datestyle = 'ISO, YMD'", __METHOD__ );
                $this->query( "SET timezone = 'GMT'", __METHOD__ );
+               $this->query( "SET standard_conforming_strings = on", __METHOD__ );
 
                global $wgDBmwschema;
                if ( $this->schemaExists( $wgDBmwschema ) ) {
@@ -878,11 +879,7 @@ SQL;
                } elseif ( is_bool( $s ) ) {
                        return intval( $s );
                } elseif ( $s instanceof Blob ) {
-                       $ret = "'" . $s->fetch( $s ) . "'";
-                       if ( $this->numeric_version >= 8.1 ) {
-                               $ret = "E$ret";
-                       }
-                       return $ret;
+                       return "'" . $s->fetch( $s ) . "'";
                }
                return "'" . pg_escape_string( $this->mConn, $s ) . "'";
        }