Fix crash with pg_partition_root
authorMichael Paquier <[email protected]>
Fri, 22 Mar 2019 08:27:38 +0000 (17:27 +0900)
committerMichael Paquier <[email protected]>
Fri, 22 Mar 2019 08:27:38 +0000 (17:27 +0900)
commit2ab6d28d233af17987ea323e3235b2bda89b4f2e
tree6bf3a4fac6e23fd3248972948d7cd8fab1bbf944
parentfff518d051285bc47e2694a349d410e01972730b
Fix crash with pg_partition_root

Trying to call the function with the top-most parent of a partition tree
was leading to a crash.  In this case the correct result is to return
the top-most parent itself.

Reported-by: Álvaro Herrera
Author: Michael Paquier
Reviewed-by: Amit Langote
Discussion: https://postgr.es/m/20190322032612[email protected]
src/backend/utils/adt/partitionfuncs.c
src/test/regress/expected/partition_info.out
src/test/regress/sql/partition_info.sql