From d0c84397f01c64894912291dbbe71b170cc7e0f1 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 4 Feb 2008 16:45:09 +0000 Subject: [PATCH] Bug 12768: make hasContraint schema aware. Thanks to Sven Klemm. --- RELEASE-NOTES | 3 +++ includes/DatabasePostgres.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4830788653..2fa17f3a1a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -153,6 +153,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN and reject interwiki prefixes. PrefixSearch class centralizes this code, and the backend part can be overridden by the PrefixSearchBackend hook. * (bug 10365) Localization of Special:Version +* When installing using Postgres, the Pl/Pgsql language is now checked for + and installed when at the superuser level. === Bug fixes in 1.12 === @@ -355,6 +357,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * The comment of a time-limited protection now contains the date in the default format * (bug 12880) wfLoadExtensionMessages does not use $fallback from MessagesXx.php * (bug 12885) Correction for Russian convertPlural function +* (bug 12768) Make DatabasePostgres->hasContraint() schema aware. == Parser changes in 1.12 == diff --git a/includes/DatabasePostgres.php b/includes/DatabasePostgres.php index 47d10ae189..124f2cd429 100644 --- a/includes/DatabasePostgres.php +++ b/includes/DatabasePostgres.php @@ -119,7 +119,8 @@ class DatabasePostgres extends Database { } function hasConstraint( $name ) { - $SQL = "SELECT 1 FROM pg_catalog.pg_constraint WHERE conname = '" . pg_escape_string( $name ) . "'"; + global $wgDBmwschema; + $SQL = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n WHERE c.connamespace = n.oid AND conname = '" . pg_escape_string( $name ) . "' AND n.nspname = '" . pg_escape_string($wgDBmwschema) ."'"; return $this->numRows($res = $this->doQuery($SQL)); } -- 2.20.1