postgresql/src/include
Tom Lane d9110d7e14 Straighten out leakproofness markings on text comparison functions.
Since we introduced the idea of leakproof functions, texteq and textne
were marked leakproof but their sibling text comparison functions were
not.  This inconsistency seemed justified because texteq/textne just
relied on memcmp() and so could easily be seen to be leakproof, while
the other comparison functions are far more complex and indeed can
throw input-dependent errors.

However, that argument crashed and burned with the addition of
nondeterministic collations, because now texteq/textne may invoke
the exact same varstr_cmp() infrastructure as the rest.  It makes no
sense whatever to give them different leakproofness markings.

After a certain amount of angst we've concluded that it's all right
to consider varstr_cmp() to be leakproof, mostly because the other
choice would be disastrous for performance of many queries where
leakproofness matters.  The input-dependent errors should only be
reachable for corrupt input data, or so we hope anyway; certainly,
if they are reachable in practice, we've got problems with requirements
as basic as maintaining a btree index on a text column.

Hence, run around to all the SQL functions that derive from varstr_cmp()
and mark them leakproof.  This should result in a useful gain in
flexibility/performance for queries in which non-leakproofness degrades
the efficiency of the query plan.

Back-patch to v12 where nondeterministic collations were added.
While this isn't an essential bug fix given the determination
that varstr_cmp() is leakproof, we might as well apply it now that
we've been forced into a post-beta4 catversion bump.

Discussion: https://postgr.es/m/31481.1568303470@sss.pgh.pa.us
2019-09-21 16:56:30 -04:00
..
access Improve handling of NULLs in KNN-GiST and KNN-SP-GiST 2019-09-19 21:49:07 +03:00
bootstrap Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
catalog Straighten out leakproofness markings on text comparison functions. 2019-09-21 16:56:30 -04:00
commands Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
common Update unicode_norm_table.h to Unicode 12.1.0 2019-06-24 22:50:56 +02:00
datatype Update copyright for 2019 2019-01-02 12:44:25 -05:00
executor Reorder EPQ work, to fix rowmark related bugs and improve efficiency. 2019-09-09 05:21:30 -07:00
fe_utils Fix typos in various places 2019-06-03 13:44:03 +09:00
foreign Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
jit Fix duplicated words in comments 2019-05-14 09:37:35 +09:00
lib Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
libpq Switch position of some declarations in libpq.h 2019-06-09 11:33:52 +09:00
mb Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
nodes Fix under-parenthesized macro definitions 2019-09-13 16:26:55 -03:00
optimizer Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
parser Require the schema qualification in pg_temp.type_name(arg). 2019-08-05 07:48:45 -07:00
partitioning Improve pruning of a default partition 2019-08-04 11:18:45 -04:00
port Replace xlc __fetch_and_add() with inline asm. 2019-09-13 19:34:18 -07:00
portability Update copyright for 2019 2019-01-02 12:44:25 -05:00
postmaster Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
regex Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
replication Remove superfluous newlines in function prototypes. 2019-07-31 00:07:09 -07:00
rewrite Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Rework examine_opclause_expression to use varonleft 2019-07-20 16:34:58 +02:00
storage Remove superfluous newlines in function prototypes. 2019-07-31 00:07:09 -07:00
tcop Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
tsearch Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
utils Fix bogus handling of XQuery regex option flags. 2019-09-17 15:39:51 -04:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
fmgr.h Fix double-word typos 2019-06-13 10:03:56 -04:00
funcapi.h Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
getaddrinfo.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
getopt_long.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
miscadmin.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pg_config.h.in Remove remaining traces of Rand_OpenSSL() from the tree 2019-06-27 08:25:26 +09:00
pg_config.h.win32 Stamp 12beta4. 2019-09-09 16:24:29 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_getopt.h Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
pg_trace.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgstat.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pgtar.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pgtime.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
port.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
postgres.h Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
rusagestub.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
windowapi.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00