From: Magnus Hagander <magnus@hagander.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
Cc: ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>
Cc: Jaime Casanova <jcasanov@systemguards.com.ec>
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCHES] Solve a problem of LC_TIME of windows.
Date: Mon, 24 Nov 2008 15:54:41 +0100
Message-ID: <492AC031.7010901@hagander.net> (raw)
In-Reply-To: <18269.1227538234@sss.pgh.pa.us>
References: <20081104094301.7EE8.52131E4D@oss.ntt.co.jp>
<3073cc9b0811102212n278644a8o7169f7c5ea562081@mail.gmail.com>
<20081111152112.B605.52131E4D@oss.ntt.co.jp>
<A32F4AB7D95646B3A358002E1FB73F9C@HIRO57887DE653>
<446F4763B989489C9B626D21AB9F6C7F@HIRO57887DE653>
<492AA5CD.8050001@hagander.net>
<18269.1227538234@sss.pgh.pa.us>
Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>> *** a/src/backend/utils/adt/pg_locale.c
>> --- b/src/backend/utils/adt/pg_locale.c
>> ***************
>> *** 54,59 ****
>> --- 54,60 ----
>> #include "utils/memutils.h"
>> #include "utils/pg_locale.h"
>
>> + #include "mb/pg_wchar.h"
>
>> #define MAX_L10N_DATA 80
>
> Please stick to the convention of including include files in
> alphabetical order.
Check.
>> + strftime_win32(char *dst, size_t dstlen, const char *format, const struct tm *tm)
>> + {
>> + size_t len;
>> + wchar_t wbuf[MAX_L10N_DATA];
>> + int encoding;
>> +
>> + encoding = GetDatabaseEncoding();
>> + if (encoding == PG_SQL_ASCII)
>> + return len;
>
> Surely this is returning an uninitialized variable, not to mention
> failing to accomplish any of the goals of the function. I don't think
> breaking things completely for SQL_ASCII was part of the plan.
Gah, true, that's me breaking it. That was correct in Hiroshi-san's
patch. My bad, sorry.
>
>> + ereport(ERROR,
>> + (errmsg("could not convert string to UTF-8:error %lu", GetLastError())));
>
> This is not exactly per message style guidelines. Maybe it's just a
> can't-happen case, but if so make it elog not ereport.
Check.
//Magnus
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 using the --to and --cc options:
reply via email
To: pgsql-patches@postgresql.org
Cc: magnus@hagander.net, tgl@sss.pgh.pa.us, z-saito@guitar.ocn.ne.jp, itagaki.takahiro@oss.ntt.co.jp, jcasanov@systemguards.com.ec, alvherre@commandprompt.com, pgsql-hackers@postgresql.org
Subject: Re: [PATCHES] Solve a problem of LC_TIME of windows.
In-Reply-To: <492AC031.7010901@hagander.net>
* 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