1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-04 20:11:56 +03:00

Fix multi-column range partitioning constraints.

The old logic was just plain wrong.

Report by Olaf Gawenda.  Patch by Amit Langote, reviewed by
Beena Emerson and by me.  Minor adjustments by me also.
This commit is contained in:
Robert Haas
2017-05-13 11:35:30 -04:00
parent 4e37b3e15c
commit f8bffe9e6d
6 changed files with 667 additions and 222 deletions

View File

@@ -182,6 +182,20 @@ list_length(const List *l)
(cell1) != NULL && (cell2) != NULL; \
(cell1) = lnext(cell1), (cell2) = lnext(cell2))
/*
* for_both_cell -
* a convenience macro which loops through two lists starting from the
* specified cells of each. This macro loops through both lists at the same
* time, stopping when either list runs out of elements. Depending on the
* requirements of the call site, it may also be wise to assert that the
* lengths of the two lists are equal, and initcell1 and initcell2 are at
* the same position in the respective lists.
*/
#define for_both_cell(cell1, initcell1, cell2, initcell2) \
for ((cell1) = (initcell1), (cell2) = (initcell2); \
(cell1) != NULL && (cell2) != NULL; \
(cell1) = lnext(cell1), (cell2) = lnext(cell2))
/*
* forthree -
* the same for three lists