[postgis-tickets] r15653 - #3184, blink fix for PgSQL 11 compile issues on protobuf, will test shortly

Paul Ramsey pramsey at cleverelephant.ca
Thu Sep 7 05:36:23 PDT 2017


Author: pramsey
Date: 2017-09-07 05:36:23 -0700 (Thu, 07 Sep 2017)
New Revision: 15653

Modified:
   trunk/postgis/geobuf.c
   trunk/postgis/mvt.c
Log:
#3184, blink fix for PgSQL 11 compile issues on protobuf, will test shortly


Modified: trunk/postgis/geobuf.c
===================================================================
--- trunk/postgis/geobuf.c	2017-09-07 12:23:13 UTC (rev 15652)
+++ trunk/postgis/geobuf.c	2017-09-07 12:36:23 UTC (rev 15653)
@@ -57,7 +57,11 @@
 	uint32_t i, k = 0;
 	bool geom_name_found = false;
 	for (i = 0; i < natts; i++) {
+#if POSTGIS_PGSQL_VERSION < 110
 		char *tkey = tupdesc->attrs[i]->attname.data;
+#else
+		char *tkey = tupdesc->attrs[i].attname.data;
+#endif
 		char *key = palloc(strlen(tkey) + 1);
 		strcpy(key, tkey);
 		if (strcmp(key, ctx->geom_name) == 0) {
@@ -113,7 +117,11 @@
 		datum = GetAttributeByNum(ctx->row, i + 1, &isnull);
 		if (isnull)
 			continue;
+#if POSTGIS_PGSQL_VERSION < 110
 		Oid typoid = getBaseType(tupdesc->attrs[i]->atttypid);
+#else
+		Oid typoid = getBaseType(tupdesc->attrs[i].atttypid);
+#endif
 		if (strcmp(type, "int2") == 0) {
 			set_int_value(value, DatumGetInt16(datum));
 		} else if (strcmp(type, "int4") == 0) {

Modified: trunk/postgis/mvt.c
===================================================================
--- trunk/postgis/mvt.c	2017-09-07 12:23:13 UTC (rev 15652)
+++ trunk/postgis/mvt.c	2017-09-07 12:36:23 UTC (rev 15653)
@@ -304,12 +304,17 @@
 	uint32_t i;
 	bool geom_name_found = false;
 	for (i = 0; i < natts; i++) {
+#if POSTGIS_PGSQL_VERSION < 110		
 		Oid typoid = getBaseType(tupdesc->attrs[i]->atttypid);
+		char *tkey = tupdesc->attrs[i]->attname.data;
+#else
+		Oid typoid = getBaseType(tupdesc->attrs[i].atttypid);
+		char *tkey = tupdesc->attrs[i].attname.data;
+#endif
 #if POSTGIS_PGSQL_VERSION >= 94
 		if (typoid == JSONBOID)
 			continue;
 #endif
-		char *tkey = tupdesc->attrs[i]->attname.data;
 		char *key = palloc(strlen(tkey) + 1);
 		strcpy(key, tkey);
 		if (strcmp(key, ctx->geom_name) == 0) {
@@ -550,9 +555,14 @@
 		if (i == ctx->geom_index)
 			continue;
 
+#if POSTGIS_PGSQL_VERSION < 110		
 		char *key = tupdesc->attrs[i]->attname.data;
+		Oid typoid = getBaseType(tupdesc->attrs[i]->atttypid);
+#else
+		char *key = tupdesc->attrs[i].attname.data;
+		Oid typoid = getBaseType(tupdesc->attrs[i].atttypid);
+#endif
 		Datum datum = GetAttributeByNum(ctx->row, i+1, &isnull);
-		Oid typoid = getBaseType(tupdesc->attrs[i]->atttypid);
 		k = get_key_index(ctx, key);
 		if (isnull) {
 			POSTGIS_DEBUG(3, "parse_values isnull detected");



More information about the postgis-tickets mailing list