pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Daniel Verite <daniel@manitou-mail.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Jeremy Schneider <schneider@ardentperf.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Built-in CTYPE provider
Date: Sun, 17 Mar 2024 17:46:33 -0400
Message-ID: <3422201.1710711993@sss.pgh.pa.us> (raw)
In-Reply-To: <7451f81ba0cb512222ab759de8ca1cffe44e9acb.camel@j-davis.com>
References: <6f3e94c0-f174-4380-9b69-072f8a838881@manitou-mail.org>
	<12e4f6a78403b33c303c20e44976f891d879be09.camel@j-davis.com>
	<612987b5-38fa-44c6-8b78-c0be5a177a70@eisentraut.org>
	<2692039df6b0cac20c5e488fa0209e8958c5fedb.camel@j-davis.com>
	<27bb0e52-801d-4f73-a0a4-02cfdd4a9ada@eisentraut.org>
	<4a69d067374d2f6bfb66f5bfb2ab9a020493d49f.camel@j-davis.com>
	<3bc653b5d562ae9e2838b11cb696816c328a489a.camel@j-davis.com>
	<163f4e2190cdf67f67016044e503c5004547e5a9.camel@j-davis.com>
	<6bdb98e68b2b05aa71f7f934e227738eac84ecee.camel@j-davis.com>
	<19b34a70-f5cf-4faf-88dc-917db44ed48d@eisentraut.org>
	<846a7e1fa2024918b58ff7583523a2f3de9a11b4.camel@j-davis.com>
	<3117d30aa911b408b90420f4f280fa0c3b5851be.camel@j-davis.com>
	<4135cf11-206d-40ed-96c0-9363c1232379@eisentraut.org>
	<7451f81ba0cb512222ab759de8ca1cffe44e9acb.camel@j-davis.com>

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





view thread (125+ messages)  latest in thread

Message-ID: <3422201.1710711993@sss.pgh.pa.us>
Permalink:  ../3422201.1710711993@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3422201.1710711993@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql@j-davis.com, peter@eisentraut.org, daniel@manitou-mail.org, robertmhaas@gmail.com, schneider@ardentperf.com
  Subject: Re: Built-in CTYPE provider
  In-Reply-To: <3422201.1710711993@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox