Re: [PATCHES] Solve a problem of LC_TIME of windows.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCHES] Solve a problem of LC_TIME of windows.
Дата
Msg-id 18269.1227538234@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCHES] Solve a problem of LC_TIME of windows.  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: [PATCHES] Solve a problem of LC_TIME of windows.  (Magnus Hagander <magnus@hagander.net>)
Re: [PATCHES] Solve a problem of LC_TIME of windows.  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
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.

> + 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.

> +         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.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Hiroshi Saito"
Дата:
Сообщение: Re: [PATCHES] Solve a problem of LC_TIME of windows.
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: [PATCHES] Solve a problem of LC_TIME of windows.