[SCM] PostGIS branch master updated. 3.6.0rc2-604-g5f207dbe5
git at osgeo.org
git at osgeo.org
Thu Jun 18 08:38:56 PDT 2026
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via 5f207dbe59a552eba46617f8436d4478aa7045f7 (commit)
from 3fd87bf0f0d4b3a2cec5eebb611f263af89010eb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5f207dbe59a552eba46617f8436d4478aa7045f7
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Thu Jun 18 19:36:32 2026 +0400
Initialize skipped union-find cluster ids
Initialize unassigned entries returned by UF_get_collapsed_cluster_ids to UINT32_MAX so callers and tests see deterministic values for elements outside the filtered cluster set.
Closes https://github.com/postgis/postgis/pull/974
References #5975
diff --git a/NEWS b/NEWS
index 578109e8d..249f6c879 100644
--- a/NEWS
+++ b/NEWS
@@ -53,6 +53,8 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
* Bug Fixes *
+ - #5975, Initialize skipped union-find cluster ids deterministically
+ (Darafei Praliaskouski)
- GH-885, [topology] Avoid GMP overflow in ring orientation for very large
finite coordinates (Darafei Praliaskouski)
- GH-892, Add OSS-Fuzz coverage for TWKB and serialized raster inputs,
diff --git a/liblwgeom/cunit/cu_unionfind.c b/liblwgeom/cunit/cu_unionfind.c
index fb00dc5c1..9deff2adb 100644
--- a/liblwgeom/cunit/cu_unionfind.c
+++ b/liblwgeom/cunit/cu_unionfind.c
@@ -4,6 +4,7 @@
* http://postgis.net
*
* Copyright 2015 Daniel Baston
+ * Copyright 2026 Darafei Praliaskouski <me at komzpa.net>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU General Public Licence. See the COPYING file.
@@ -148,15 +149,13 @@ static void test_unionfind_collapse_cluster_ids(void)
lwfree(collapsed_ids);
uint8_t is_in_cluster[] = {0, 1, 1, 1, 0, 1, 0, 0, 0, 0};
- uint32_t expected_collapsed_ids2[] = { 8, 0, 0, 0, 7, 0, 8, 7, 8, 7 };
+ uint32_t expected_collapsed_ids2[] = {
+ UINT32_MAX, 0, 0, 0, UINT32_MAX, 0, UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX};
collapsed_ids = UF_get_collapsed_cluster_ids(uf, is_in_cluster);
uint32_t i;
for (i = 0; i < uf->N; i++)
- {
- if (is_in_cluster[i])
- ASSERT_INT_EQUAL(expected_collapsed_ids2[i], collapsed_ids[i]);
- }
+ ASSERT_INT_EQUAL(expected_collapsed_ids2[i], collapsed_ids[i]);
lwfree(collapsed_ids);
UF_destroy(uf);
diff --git a/liblwgeom/lwunionfind.c b/liblwgeom/lwunionfind.c
index 9ca47a1c3..7e78d8064 100644
--- a/liblwgeom/lwunionfind.c
+++ b/liblwgeom/lwunionfind.c
@@ -19,10 +19,10 @@
**********************************************************************
*
* Copyright 2015 Daniel Baston <dbaston at gmail.com>
+ * Copyright 2026 Darafei Praliaskouski <me at komzpa.net>
*
**********************************************************************/
-
#include "liblwgeom.h"
#include "lwunionfind.h"
#include <string.h>
@@ -150,6 +150,8 @@ UF_get_collapsed_cluster_ids(UNIONFIND *uf, const uint8_t *is_in_cluster)
uint32_t last_old_id, current_new_id, i;
uint8_t encountered_cluster = LW_FALSE;
+ memset(new_ids, 0xFF, uf->N * sizeof(uint32_t));
+
current_new_id = 0; last_old_id = 0;
for (i = 0; i < uf->N; i++)
{
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 ++
liblwgeom/cunit/cu_unionfind.c | 9 ++++-----
liblwgeom/lwunionfind.c | 4 +++-
3 files changed, 9 insertions(+), 6 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list