pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: eshkinkot@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #8702: psql \df+ translate_columns[] overflow and unexpected gettext translation
Date: Fri, 27 Dec 2013 00:00:37 +0000
Message-ID: <E1VwKqz-0005WO-PP@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      8702
Logged by:          Sergey Burladyan
Email address:      eshkinkot@gmail.com
PostgreSQL version: 9.3.1
Operating system:   Debian testing
Description:        

I get this result from \df+ foo:
--- echo $LANG
--- ru_RU.UTF-8
---
--- create function foo() returns void language plpgsql as $$ begin end $$;


Список функций
-[ RECORD 1
]----------+---------------------------------------------------------------------------------------------------------------------
Схема                  | public
Имя                    | foo
Тип данных результата  | void
Типы данных аргументов | 
Тип                    | обычная
Безопасность           | вызывающего
Изменчивость           | volatile
Владелец               | seb
Язык                   | plpgsql
Исходный код           |  begin end 
Описание               | Project-Id-Version: PostgreSQL 9 current
                       | Report-Msgid-Bugs-To: pgsql-bugs@postgresql.org
                       | POT-Creation-Date: 2013-05-20 02:16+0000
                       | PO-Revision-Date: 2013-05-20 20:02+0400
                       | Last-Translator: Alexander Lakhin
<exclusion@gmail.com>
                       | Language-Team: Russian
<pgtranslation-translators@pgfoundry.org>
                       | Language: ru
                       | MIME-Version: 1.0
                       | Content-Type: text/plain; charset=UTF-8
                       | Content-Transfer-Encoding: 8bit
                       | X-Poedit-Language: Russian
                       | X-Poedit-Country: RUSSIAN FEDERATION
                       | X-Generator: Lokalize 1.5
                       | Plural-Forms: nplurals=3; plural=(n%10==1 &&
n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);
                       | 


looks like "Description" field contains header from ru.mo messages file.


src/bin/psql/describe.c:describeFunctions translate_columns[] array size
is less than the maximum number of columns in query and it overflowed in
src/bin/psql/print.c:printQuery at
...
            translate = (opt->translate_columns &&
opt->translate_columns[c]);
...
so in my case opt->translate_columns[10] have garbage == true and
"Description" field
content translated unexpectedly.




-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)  latest in thread

Message-ID: <E1VwKqz-0005WO-PP@wrigleys.postgresql.org>
Permalink:  ../E1VwKqz-0005WO-PP@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1VwKqz-0005WO-PP@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: eshkinkot@gmail.com
  Subject: Re: BUG #8702: psql \df+ translate_columns[] overflow and unexpected gettext translation
  In-Reply-To: <E1VwKqz-0005WO-PP@wrigleys.postgresql.org>
  References: <E1VwKqz-0005WO-PP@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox