Subject: bugfifx: a minor mistake in brin_inclusion.c comment

From: Tomas Vondra <[email-masked]>
Date: Fri, 23 Mar 2018 01:32:55 +0100

Hi,

while looking at brin_inclusion.c, I've noticed that the comment about
INCLUSION_UNMERGEABLE and INCLUSION_CONTAINS_EMPTY uses incorrect values
(1 instead of 2). Attached is a simple fix.

But perhaps it would be better to use the constants in the comment.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
diff --git a/src/backend/access/brin/brin_inclusion.c b/src/backend/access/brin/brin_inclusion.c
index 2542877..d8042b0 100644
--- a/src/backend/access/brin/brin_inclusion.c
+++ b/src/backend/access/brin/brin_inclusion.c
@@ -60,9 +60,9 @@
  * The values stored in the bv_values arrays correspond to:
  *
  * 0 - the union of the values in the block range
- * 1 - whether an empty value is present in any tuple in the block range
- * 2 - whether the values in the block range cannot be merged (e.g. an IPv6
+ * 1 - whether the values in the block range cannot be merged (e.g. an IPv6
  *	   address amidst IPv4 addresses).
+ * 2 - whether an empty value is present in any tuple in the block range
  */
 #define INCLUSION_UNION				0
 #define INCLUSION_UNMERGEABLE		1

---

From: Alvaro Herrera <[email-masked]>
Date: Mon, 26 Mar 2018 12:11:26 -0300

> (1 instead of 2). Attached is a simple fix.

Uh, yeah, this is wrong.

> But perhaps it would be better to use the constants in the comment.

I fixed it like this, which seems neater.

Thanks!

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services