Re: tiny step toward threading: reduce dependence on setlocale() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: tiny step toward threading: reduce dependence on setlocale()
Date
Msg-id 3804933.1723394010@sss.pgh.pa.us
Whole thread Raw
In response to Re: tiny step toward threading: reduce dependence on setlocale()  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: tiny step toward threading: reduce dependence on setlocale()
List pgsql-hackers
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
tothe 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Restricting Direct Access to a C Function in PostgreSQL
Next
From: Sergei Kornilov
Date:
Subject: Re: pg_stat_statements and "IN" conditions