Jeff Davis <pg...@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