| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Bruce Momjian <bruce(at)momjian(dot)us> |
| Cc: | Tatsuo Ishii <ishii(at)postgresql(dot)org>, pg(at)heroku(dot)com, pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql |
| Date: | 2014-03-22 15:55:56 |
| Message-ID: | 19770.1395503756@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Bruce Momjian <bruce(at)momjian(dot)us> writes:
> 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:
Agreed that that's pretty useless. I wonder though why these functions
are not coded like
return PG_VALID_ENCODING(encoding) ?
((*pg_wchar_table[encoding].mblen) ((const unsigned char *) mbstr)) :
((*pg_wchar_table[PG_SQL_ASCII].mblen) ((const unsigned char *) mbstr)));
instead of the hard-to-read explicit range check.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2014-03-22 15:59:13 | Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql |
| Previous Message | Bruce Momjian | 2014-03-22 15:55:05 | Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql |