Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql
От | Bruce Momjian |
---|---|
Тема | Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql |
Дата | |
Msg-id | 20140322155505.GA17107@momjian.us обсуждение исходный текст |
Ответ на | Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql (Bruce Momjian <bruce@momjian.us>) |
Ответы |
Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql
|
Список | pgsql-bugs |
On Sat, Mar 22, 2014 at 11:17:23AM -0400, Bruce Momjian wrote: > OK, hearing nothing, I dug into this, and I think the solution is > simpler than we thought. Basically, the Assert is checking for the > encoding value to be in a valid range, but the main code is also > checking for an invalid encoding and returning PG_SQL_ASCII: > > pg_encoding_mblen(int encoding, const char *mbstr) > { > Assert(PG_VALID_ENCODING(encoding)); > > return ((encoding >= 0 && > encoding < sizeof(pg_wchar_table) / sizeof(pg_wchar_tbl)) ? > ((*pg_wchar_table[encoding].mblen) ((const unsigned char *) mbstr)) : > ((*pg_wchar_table[PG_SQL_ASCII].mblen) ((const unsigned char *) mbstr))); > } Also, what is the difference between _PG_LAST_ENCODING_, which is the last encoding enum, and the pg_wchar_tbl length calculation? Are they the same? If so, we should just use _PG_LAST_ENCODING_. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +
В списке pgsql-bugs по дате отправления: