[postgis-tickets] r15690 - #3841, make POINT EMPTY < LINESTRING EMPTY

Paul Ramsey pramsey at cleverelephant.ca
Mon Sep 11 10:52:50 PDT 2017


Author: pramsey
Date: 2017-09-11 10:52:50 -0700 (Mon, 11 Sep 2017)
New Revision: 15690

Modified:
   trunk/postgis/geography_btree.c
Log:
#3841, make POINT EMPTY < LINESTRING EMPTY


Modified: trunk/postgis/geography_btree.c
===================================================================
--- trunk/postgis/geography_btree.c	2017-09-11 17:42:48 UTC (rev 15689)
+++ trunk/postgis/geography_btree.c	2017-09-11 17:52:50 UTC (rev 15690)
@@ -72,7 +72,10 @@
 
 	/* Empty == Empty */
 	if (g1_is_empty && g2_is_empty)
-		return 0;
+    {
+        /* Actually make it so that POINT EMPTY < LINESTRING EMPTY */
+		return gserialized_get_type(g1) < gserialized_get_type(g2) ? -1 : 1;
+    }
 	
 	/* Empty < Non-empty */
 	if (g1_is_empty)



More information about the postgis-tickets mailing list