1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-31499 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult.

Calculate prev_range when the polygon's border is met.
Otherwise we can falsely mark polygon as a 'hole' which breaks the
topology of the result.
This commit is contained in:
Alexey Botchkov
2025-09-26 17:03:51 +04:00
parent 13047cdc97
commit aada4e213c
3 changed files with 21 additions and 0 deletions

View File

@@ -860,3 +860,13 @@ TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10)
SELECT TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10);
TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10)
55878.5933759170
#
# MDEV-31499 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult.
#
SELECT ST_NUMGEOMETRIES(
ST_INTERSECTION(
ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3.8571428571428568 2.857142857142857,5.571428571428571 4.571428571428571,9 4,3.8571428571428568 2.857142857142857)),((4.5 4.75,3 5,4.6 7.4,6 6,4.5 4.75))) '), ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 4,3 5,2 5,2 7,5 4,3 4),(5 4,7.4 7,8 7,8 4,5 4))) ') ));
ST_NUMGEOMETRIES(
ST_INTERSECTION(
ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3.8571428571428568 2.857142857142857,5.571428571428571 4.571428571428571,9 4,3.8571428571428568 2.857142857142857)),((4.5 4.75,3 5,4.6 7.4,6 6,4.5 4.75))) '), ST
3

View File

@@ -476,3 +476,13 @@ set @zenica = ST_GeomFromText('POINT(17.907743 44.203438)');
set @sarajevo = ST_GeomFromText('POINT(18.413076 43.856258)');
SELECT TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10);
SELECT TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10);
--echo #
--echo # MDEV-31499 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult.
--echo #
SELECT ST_NUMGEOMETRIES(
ST_INTERSECTION(
ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3.8571428571428568 2.857142857142857,5.571428571428571 4.571428571428571,9 4,3.8571428571428568 2.857142857142857)),((4.5 4.75,3 5,4.6 7.4,6 6,4.5 4.75))) '), ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 4,3 5,2 5,2 7,5 4,3 4),(5 4,7.4 7,8 7,8 4,5 4))) ') ));

View File

@@ -928,6 +928,7 @@ int Gcalc_operation_reducer::count_slice(Gcalc_scan_iterator *si)
{
add_poly_border(1, cur_t, prev_state, events);
prev_state^= 1;
prev_range= prev_state ? cur_t : 0;
}
if (!events->is_bottom())
{