Re: Built-in CTYPE provider - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Built-in CTYPE provider
Date
Msg-id 3422201.1710711993@sss.pgh.pa.us
Whole thread Raw
In response to Re: Built-in CTYPE provider  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Built-in CTYPE provider
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> New series attached.

Coverity thinks there's something wrong with builtin_validate_locale,
and as far as I can tell it's right: the last ereport is unreachable,
because required_encoding is never changed from its initial -1 value.
It looks like there's a chunk of logic missing there, or else that
the code could be simplified further.

/srv/coverity/git/pgsql-git/postgresql/src/backend/utils/adt/pg_locale.c: 2519 in builtin_validate_locale()
>>>     CID 1594398:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "encoding != required_encoding" inside this statement: "if
(required_encoding>= 0 ...". 
2519         if (required_encoding >= 0 && encoding != required_encoding)
2520             ereport(ERROR,
2521                     (errcode(ERRCODE_WRONG_OBJECT_TYPE),
2522                      errmsg("encoding \"%s\" does not match locale \"%s\"",
2523                             pg_encoding_to_char(encoding), locale)));

            regards, tom lane



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Popcount optimization using AVX512
Next
From: Michael Paquier
Date:
Subject: Re: Autogenerate some wait events code and documentation