From 3531c0973d5b20ffb4bed51de9ff4f3985811536 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud Date: Fri, 23 Nov 2018 21:40:19 +0100 Subject: [PATCH] Reintroduce childrel expanding order for pg10 The partitions has to be sorted by bound order, otherwise many things can break. This commit also introduce specific regression tests for pg10, for which the duplucate sanity check would not exhibit the expected error without the expanded order. Some of these new regression tests still fails, due to minor change in the join or partition order, we'll see if we can fix the behavior or change the expected results. --- Makefile | 7 ++++++- hypopg_table.c | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 31e2b5f..ef2879f 100644 --- a/Makefile +++ b/Makefile @@ -35,10 +35,15 @@ include $(PGXS) ifeq ($(MAJORVERSION),$(filter $(MAJORVERSION),9.2 9.3 9.4 9.5 9.6)) REGRESS += hypo_no_table +else +ifeq ($(MAJORVERSION),$(filter $(MAJORVERSION),10)) + REGRESS += hypo_table_10 \ + hypo_index_table_10 else REGRESS += hypo_table \ hypo_index_table -endif +endif # pg10 +endif # pg 11+ DEBUILD_ROOT = /tmp/$(EXTENSION) diff --git a/hypopg_table.c b/hypopg_table.c index b8f19e7..c534d03 100644 --- a/hypopg_table.c +++ b/hypopg_table.c @@ -632,10 +632,8 @@ hypo_generate_partitiondesc(hypoTable *parent) i++; } -#if PG_VERSION_NUM >= 110000 qsort_arg(all_values, ndatums, sizeof(PartitionListValue *), qsort_partition_list_value_cmp, (void *) key); -#endif } else if (key->strategy == PARTITION_STRATEGY_RANGE) { @@ -693,13 +691,11 @@ hypo_generate_partitiondesc(hypoTable *parent) Assert(ndatums == nparts * 2 || (default_index != -1 && ndatums == (nparts - 1) * 2)); -#if PG_VERSION_NUM >= 110000 /* Sort all the bounds in ascending order */ qsort_arg(all_bounds, ndatums, sizeof(PartitionRangeBound *), qsort_partition_rbound_cmp, (void *) key); -#endif /* Save distinct bounds from all_bounds into rbounds. */ rbounds = (PartitionRangeBound **)