Enforce cube dimension limit in all cube construction functions

Alexander Korotkov <akorotkov@postgresql.org>

Commit: 9f3ade1a6f62dd0315aa14b615666e0d54054763
Author: Alexander Korotkov <akorotkov@postgresql.org>
Date: 2018-08-31T17:21:30Z
Releases: 9.3.25
Enforce cube dimension limit in all cube construction functions

contrib/cube has a limit to 100 dimensions for cube datatype.  However, it's
not enforced everywhere, and one can actually construct cube with more than
100 dimensions having then trouble with dump/restore.  This commit add checks
for dimensions limit in all functions responsible for cube construction.
Backpatch to all supported versions.

Reported-by: Andrew Gierth
Discussion: https://postgr.es/m/87va7uybt4.fsf%40news-spur.riddles.org.uk
Author: Andrey Borodin with small additions by me
Review: Tom Lane
Backpatch-through: 9.3

Files

PathChange+/−
contrib/cube/cube.c modified +34 −0
contrib/cube/expected/cube.out modified +40 −0
contrib/cube/sql/cube.sql modified +17 −1

Discussion