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: Andreas Karlsson <andreas@proxel.se>
Cc: pgsql-hackers@postgresql.org
Subject: Re: tiny step toward threading: reduce dependence on setlocale()
Date: Sun, 11 Aug 2024 12:33:30 -0400
Message-ID: <3804933.1723394010@sss.pgh.pa.us> (raw)
In-Reply-To: <23cc1f3cfcdbdd3b2d3bb956d57ae422aa9d0b9e.camel@j-davis.com>
References: <2228884bb1f1a02614b39f71a90c94d2cc8a3a2f.camel@j-davis.com>
	<239b7ef6ce058c6b1c77b3a0cfcc70c1cd8968b1.camel@j-davis.com>
	<f1935bc481438c9d86c2e0ac537b1c110d41a00a.camel@j-davis.com>
	<cfd9eb85-c52a-4ec9-a90e-a5e4de56e57d@eisentraut.org>
	<56af65bde2190cc5ee20c807be7b7bdcda54f40c.camel@j-davis.com>
	<468dd1fb-20f5-4213-bc70-d1388ccf28fa@proxel.se>
	<59ea4275d75829a055fc55d8fe139eb85764cf2b.camel@j-davis.com>
	<ece40520-ca74-4b22-8463-f48215854511@proxel.se>
	<de1f1788-93bb-45cc-bef8-6f27119b2f3e@eisentraut.org>
	<89475ee5487d795124f4e25118ea8f1853edb8cb.camel@j-davis.com>
	<23cc1f3cfcdbdd3b2d3bb956d57ae422aa9d0b9e.camel@j-davis.com>

Jeff Davis <pgsql@j-davis.com> writes:
> We can address those as part of a separate thread. I'll count this as
> committed.

Coverity has a nit about this:

*** CID 1616189:  Null pointer dereferences  (REVERSE_INULL)
/srv/coverity/git/pgsql-git/postgresql/src/backend/utils/adt/like.c: 206 in Generic_Text_IC_like()
200     	 * on the pattern and text, but instead call SB_lower_char on each
201     	 * character.  In the multi-byte case we don't have much choice :-(. Also,
202     	 * ICU does not support single-character case folding, so we go the long
203     	 * way.
204     	 */
205     
>>>     CID 1616189:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "locale" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
206     	if (pg_database_encoding_max_length() > 1 || (locale && locale->provider == COLLPROVIDER_ICU))
207     	{
208     		pat = DatumGetTextPP(DirectFunctionCall1Coll(lower, collation,
209     													 PointerGetDatum(pat)));
210     		p = VARDATA_ANY(pat);
211     		plen = VARSIZE_ANY_EXHDR(pat);

I assume it would now be okay to take out "locale &&" here?

			regards, tom lane





view thread (33+ messages)  latest in thread

Message-ID: <3804933.1723394010@sss.pgh.pa.us>
Permalink:  ../3804933.1723394010@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3804933.1723394010@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql@j-davis.com, peter@eisentraut.org, andreas@proxel.se
  Subject: Re: tiny step toward threading: reduce dependence on setlocale()
  In-Reply-To: <3804933.1723394010@sss.pgh.pa.us>
  References: <2228884bb1f1a02614b39f71a90c94d2cc8a3a2f.camel@j-davis.com> <239b7ef6ce058c6b1c77b3a0cfcc70c1cd8968b1.camel@j-davis.com> <f1935bc481438c9d86c2e0ac537b1c110d41a00a.camel@j-davis.com> <cfd9eb85-c52a-4ec9-a90e-a5e4de56e57d@eisentraut.org> <56af65bde2190cc5ee20c807be7b7bdcda54f40c.camel@j-davis.com> <468dd1fb-20f5-4213-bc70-d1388ccf28fa@proxel.se> <59ea4275d75829a055fc55d8fe139eb85764cf2b.camel@j-davis.com> <ece40520-ca74-4b22-8463-f48215854511@proxel.se> <de1f1788-93bb-45cc-bef8-6f27119b2f3e@eisentraut.org> <89475ee5487d795124f4e25118ea8f1853edb8cb.camel@j-davis.com> <23cc1f3cfcdbdd3b2d3bb956d57ae422aa9d0b9e.camel@j-davis.com> <3804933.1723394010@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