]> git.pld-linux.org Git - packages/postgresql.git/commitdiff
- release 3: postgresql-pg_perm_setlocale.patch (index corruption with plperl)
authorradek <radek@pld-linux.org>
Wed, 8 Jul 2009 18:32:26 +0000 (18:32 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    postgresql-pg_perm_setlocale.patch -> 1.1
    postgresql.spec -> 1.430

postgresql-pg_perm_setlocale.patch [new file with mode: 0644]
postgresql.spec

diff --git a/postgresql-pg_perm_setlocale.patch b/postgresql-pg_perm_setlocale.patch
new file mode 100644 (file)
index 0000000..b94ee2d
--- /dev/null
@@ -0,0 +1,45 @@
+From bfb56a2ad7b489c04bfc90628e0cb3766763ecca Mon Sep 17 00:00:00 2001
+From: Heikki Linnakangas <heikki@enterprisedb.com>
+Date: Wed, 8 Jul 2009 17:53:32 +0000
+Subject: [PATCH] Need to use pg_perm_setlocale when setting LC_CTYPE and LC_COLLATE at startup.
+ Otherwise, the LC_CTYPE/COLLATE setting gets reverted when using plperl, which
+ leads to incorrect query results and index corruption.
+
+This was accidentally broken in the per-database locale patch in 8.4. Pointed
+out by Andrew Gierth.
+---
+ src/backend/utils/init/postinit.c |    5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
+index 6b98bed..327ba7c 100644
+--- a/src/backend/utils/init/postinit.c
++++ b/src/backend/utils/init/postinit.c
+@@ -44,6 +44,7 @@
+ #include "utils/acl.h"
+ #include "utils/flatfiles.h"
+ #include "utils/guc.h"
++#include "utils/pg_locale.h"
+ #include "utils/plancache.h"
+ #include "utils/portal.h"
+ #include "utils/relcache.h"
+@@ -247,14 +248,14 @@ CheckMyDatabase(const char *name, bool am_superuser)
+       collate = NameStr(dbform->datcollate);
+       ctype = NameStr(dbform->datctype);
+-      if (setlocale(LC_COLLATE, collate) == NULL)
++      if (pg_perm_setlocale(LC_COLLATE, collate) == NULL)
+               ereport(FATAL,
+                       (errmsg("database locale is incompatible with operating system"),
+                        errdetail("The database was initialized with LC_COLLATE \"%s\", "
+                                          " which is not recognized by setlocale().", collate),
+                        errhint("Recreate the database with another locale or install the missing locale.")));
+-      if (setlocale(LC_CTYPE, ctype) == NULL)
++      if (pg_perm_setlocale(LC_CTYPE, ctype) == NULL)
+               ereport(FATAL,
+                       (errmsg("database locale is incompatible with operating system"),
+                        errdetail("The database was initialized with LC_CTYPE \"%s\", "
+-- 
+1.6.3.1
+
index c830e1ef15c759aae24aad8b3b6dba0e904816c9..2ad820c5d1a23b1d018309314de43aafb6981d40 100644 (file)
@@ -25,7 +25,7 @@ Summary(uk.UTF-8):    PostgreSQL - система керування базами 
 Summary(zh_CN.UTF-8):  PostgreSQL 客户端程序和库文件
 Name:          postgresql
 Version:       %{mver}.0
-Release:       2
+Release:       3
 License:       BSD
 Group:         Applications/Databases
 Source0:       ftp://ftp.postgresql.org/pub/source/v%{version}/%{name}-%{version}.tar.bz2
@@ -40,6 +40,7 @@ Patch2:               %{name}-ecpg-includedir.patch
 Patch3:                %{name}-ac_version.patch
 Patch4:                %{name}-disable_horology_test.patch
 Patch5:                %{name}-pg_ctl-fix.patch
+Patch6:                %{name}-pg_perm_setlocale.patch
 URL:           http://www.postgresql.org/
 BuildRequires: autoconf
 BuildRequires: automake
@@ -765,6 +766,7 @@ Różne moduły dołączone do PostgreSQL-a.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 tar xzf doc/man*.tar.gz
 
This page took 0.991982 seconds and 4 git commands to generate.