postgresql/src/include
Tom Lane f8ace5477e Fix type-safety problem with parallel aggregate serial/deserialization.
The original specification for this called for the deserialization function
to have signature "deserialize(serialtype) returns transtype", which is a
security violation if transtype is INTERNAL (which it always would be in
practice) and serialtype is not (which ditto).  The patch blithely overrode
the opr_sanity check for that, which was sloppy-enough work in itself,
but the indisputable reason this cannot be allowed to stand is that CREATE
FUNCTION will reject such a signature and thus it'd be impossible for
extensions to create parallelizable aggregates.

The minimum fix to make the signature type-safe is to add a second, dummy
argument of type INTERNAL.  But to lock it down a bit more and make misuse
of INTERNAL-accepting functions less likely, let's get rid of the ability
to specify a "serialtype" for an aggregate and just say that the only
useful serialtype is BYTEA --- which, in practice, is the only interesting
value anyway, due to the usefulness of the send/recv infrastructure for
this purpose.  That means we only have to allow "serialize(internal)
returns bytea" and "deserialize(bytea, internal) returns internal" as
the signatures for these support functions.

In passing fix bogus signature of int4_avg_combine, which I found thanks
to adding an opr_sanity check on combinefunc signatures.

catversion bump due to removing pg_aggregate.aggserialtype and adjusting
signatures of assorted built-in functions.

David Rowley and Tom Lane

Discussion: <27247.1466185504@sss.pgh.pa.us>
2016-06-22 16:52:41 -04:00
..
access pg_visibility: Add pg_truncate_visibility_map function. 2016-06-17 17:37:30 -04:00
bootstrap Update copyright for 2016 2016-01-02 13:33:40 -05:00
catalog Fix type-safety problem with parallel aggregate serial/deserialization. 2016-06-22 16:52:41 -04:00
commands Support ALTER THING .. DEPENDS ON EXTENSION 2016-04-05 18:38:54 -03:00
common pgindent run for 9.6 2016-06-09 18:02:36 -04:00
datatype Be more careful about out-of-range dates and timestamps. 2016-03-16 19:09:28 -04:00
executor pgindent run for 9.6 2016-06-09 18:02:36 -04:00
fe_utils Move and rename fmtReloptionsArray(). 2016-05-06 12:45:36 +01:00
foreign pgindent run for 9.6 2016-06-09 18:02:36 -04:00
lib Remove mergeHyperLogLog. 2016-04-27 10:55:32 -04:00
libpq Add authentication parameters compat_realm and upn_usename for SSPI 2016-04-08 20:28:38 +02:00
mb Update copyright for 2016 2016-01-02 13:33:40 -05:00
nodes Refactor planning of projection steps that don't need a Result plan node. 2016-06-21 18:38:20 -04:00
optimizer Refactor planning of projection steps that don't need a Result plan node. 2016-06-21 18:38:20 -04:00
parser Fix type-safety problem with parallel aggregate serial/deserialization. 2016-06-22 16:52:41 -04:00
port Fix various common mispellings. 2016-06-03 16:08:45 +01:00
portability Update copyright for 2016 2016-01-02 13:33:40 -05:00
postmaster Allow Pin/UnpinBuffer to operate in a lockfree manner. 2016-04-10 20:12:32 -07:00
regex Suppress compiler warnings about useless comparison of unsigned to zero. 2016-02-15 17:12:16 -05:00
replication pgindent run for 9.6 2016-06-09 18:02:36 -04:00
rewrite Update copyright for 2016 2016-01-02 13:33:40 -05:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Change default of backend_flush_after GUC to 0 (disabled). 2016-06-10 15:31:11 -07:00
tcop Stop the executor if no more tuples can be sent from worker to leader. 2016-06-06 14:52:58 -04:00
tsearch pgindent run for 9.6 2016-06-09 18:02:36 -04:00
utils Restore foreign-key-aware estimation of join relation sizes. 2016-06-18 15:22:34 -04:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
Makefile Create src/fe_utils/, and move stuff into there from pg_dump's dumputils. 2016-03-24 15:55:57 -04:00
c.h Make init_spin_delay() C89 compliant and change stuck spinlock reporting. 2016-04-13 17:00:53 -07:00
fmgr.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
funcapi.h Widen query numbers-of-tuples-processed counters to uint64. 2016-03-12 16:05:29 -05:00
getaddrinfo.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
getopt_long.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
miscadmin.h Mark PostmasterPid as PGDLLIMPORT. 2016-06-03 14:06:35 -04:00
pg_config.h.in Add BSD authentication method. 2016-04-08 13:52:06 -04:00
pg_config.h.win32 Stamp 9.6beta2. 2016-06-20 16:23:47 -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 Add support for more extensive testing of raw_expression_tree_walker(). 2016-05-23 19:08:26 -04:00
pg_getopt.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_trace.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pgstat.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
pgtar.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pgtime.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
port.h On all Windows platforms, not just Cygwin, use _timezone and _tzname. 2016-03-28 20:59:25 -04:00
postgres.h Adjust DatumGetBool macro, this time for sure. 2016-04-28 11:50:58 -04:00
postgres_ext.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fe.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
rusagestub.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
windowapi.h Update copyright for 2016 2016-01-02 13:33:40 -05:00