[Git][debian-gis-team/pgsql-ogr-fdw][upstream] New upstream version 1.1.8

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Tue Jun 16 04:55:11 BST 2026



Bas Couwenberg pushed to branch upstream at Debian GIS Project / pgsql-ogr-fdw


Commits:
b747e831 by Bas Couwenberg at 2026-06-16T05:42:57+02:00
New upstream version 1.1.8
- - - - -


4 changed files:

- .github/workflows/ci.yml
- ogr_fdw.c
- ogr_fdw_deparse.c
- ogr_fdw_info.c


Changes:

=====================================
.github/workflows/ci.yml
=====================================
@@ -16,19 +16,17 @@ jobs:
         fail-fast: false
         matrix:
           ci:
-          - { PGVER: 11 }
-          - { PGVER: 12 }
-          - { PGVER: 13 }
-          - { PGVER: 14 }
           - { PGVER: 15 }
           - { PGVER: 16 }
           - { PGVER: 17 }
+          - { PGVER: 18 }
+          - { PGVER: 19 }
 
     runs-on: ubuntu-latest
     steps:
 
     - name: 'Check Out'
-      uses: actions/checkout at v4
+      uses: actions/checkout at v5
 
     - name: 'Raise Priority for apt.postgresql.org'
       run: |
@@ -47,7 +45,7 @@ jobs:
     - name: 'Install PostgreSQL'
       run: |
         sudo apt-get purge postgresql-*
-        sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-snapshot main ${{ matrix.ci.PGVER }}" > /etc/apt/sources.list.d/pgdg.list'
+        sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main ${{ matrix.ci.PGVER }}" > /etc/apt/sources.list.d/pgdg.list'
         curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
         sudo apt-get update
         sudo apt-get -y install postgresql-${{ matrix.ci.PGVER }} postgresql-server-dev-${{ matrix.ci.PGVER }}


=====================================
ogr_fdw.c
=====================================
@@ -1451,7 +1451,7 @@ ogrReadColumnData(OgrFdwState* state)
 	{
 		char* fldname = pstrdup(OGR_Fld_GetNameRef(OGR_FD_GetFieldDefn(dfn, i)));
 		char* fldname_laundered = palloc(STR_MAX_LEN);
-		strncpy(fldname_laundered, fldname, STR_MAX_LEN);
+		strlcpy(fldname_laundered, fldname, STR_MAX_LEN);
 		ogrStringLaunder(fldname_laundered);
 		ogr_fields[2 * i].fldname = fldname;
 		ogr_fields[2 * i].fldnum = i;
@@ -1790,7 +1790,7 @@ pgDatumFromCString(const char* cstr, const OgrFdwColumn *col, int char_encoding,
 	if (cstr != cstr_decoded)
 		pfree(cstr_decoded);
 
-	is_null = false;
+	*is_null = false;
 	return value;
 }
 
@@ -2064,7 +2064,7 @@ ogrFeatureToSlot(const OGRFeatureH feat, TupleTableSlot* slot, const OgrFdwExecS
 				{
 #if (GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,7,0))
 					const char* tsstr = OGR_F_GetFieldAsISO8601DateTime(feat, ogrfldnum, NULL);
-					strncpy(cstr, tsstr, CSTR_SZ);
+					strlcpy(cstr, tsstr, CSTR_SZ);
 #else
 					snprintf(cstr, CSTR_SZ, "%d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, minute, second);
 #endif
@@ -2439,9 +2439,10 @@ ogrSlotToFeature(const TupleTableSlot* slot, OGRFeatureH feat, const OgrFdwTable
 
 			case BYTEAOID:
 			{
-				bytea* varlena = PG_DETOAST_DATUM(values[i]);
-				size_t varsize = VARSIZE_ANY_EXHDR(varlena);
-				OGR_F_SetFieldBinary(feat, ogrfldnum, varsize, (GByte*)VARDATA_ANY(varlena));
+				struct varlena *detoasted_dat = (struct varlena *) PG_DETOAST_DATUM(values[i]);
+				size_t varsize = VARSIZE_ANY_EXHDR(detoasted_dat);
+				OGR_F_SetFieldBinary(feat, ogrfldnum, varsize, (GByte*)VARDATA_ANY(detoasted_dat));
+
 				break;
 			}
 
@@ -3259,13 +3260,13 @@ ogrImportForeignSchema(ImportForeignSchemaStmt* stmt, Oid serverOid)
 		}
 
 		/* Layer name is never laundered, since it's the link back to OGR */
-		strncpy(layer_name, OGR_L_GetName(ogr_lyr), STR_MAX_LEN);
+		strlcpy(layer_name, OGR_L_GetName(ogr_lyr), STR_MAX_LEN);
 
 		/*
 		* We need to compare against created table names
 		* because PgSQL does an extra check on CREATE FOREIGN TABLE
 		*/
-		strncpy(table_name, layer_name, STR_MAX_LEN);
+		strlcpy(table_name, layer_name, STR_MAX_LEN);
 		if (launder_table_names)
 		{
 			ogrStringLaunder(table_name);


=====================================
ogr_fdw_deparse.c
=====================================
@@ -176,7 +176,7 @@ ogrDeparseConst(Const* constant, OgrDeparseCtx* context)
 		OGR_G_CreateFromWkb((unsigned char*)wkb, NULL, &ogrgeom, wkb_size);
 		OGR_G_ExportToWkt(ogrgeom, &wkt);
 		elog(DEBUG1, "ogrDeparseConst got a geometry: %s", wkt);
-		free(wkt);
+		CPLFree(wkt);
 		OGR_G_DestroyGeometry(ogrgeom);
 
 		/*


=====================================
ogr_fdw_info.c
=====================================
@@ -21,7 +21,7 @@
 #include "ogr_fdw_gdal.h"
 #include "ogr_fdw_common.h"
 
-static void usage();
+static void usage(void);
 static OGRErr ogrListLayers(const char* source);
 static OGRErr ogrFindLayer(const char* source, int layerno, const char** layer);
 static OGRErr ogrGenerateSQL(const char* server, const char* layer, const char* table, const char* source, const char* options);
@@ -64,15 +64,19 @@ static char identifier[NAMEDATALEN+3];
 const char*
 quote_identifier(const char* ident)
 {
+#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0)
+	int len = (int)CPL_MIN(strlen(ident), NAMEDATALEN - 1);
+#else
 	int len = (int)MIN(strlen(ident), NAMEDATALEN - 1);
+#endif
 
 	if (reserved_word(ident))
 	{
-		sprintf(identifier,"\"%*s\"", len, ident);
+		snprintf(identifier, sizeof(identifier), "\"%.*s\"", len, ident);
 	}
 	else
 	{
-		sprintf(identifier,"%*s", len, ident);
+		snprintf(identifier, sizeof(identifier), "%.*s", len, ident);
 	}
   return identifier;
 }
@@ -81,7 +85,7 @@ static char config_options[STR_MAX_LEN] = {0};
 
 
 static void
-formats()
+formats(void)
 {
 	int i;
 
@@ -125,7 +129,7 @@ formats()
 }
 
 static void
-usage()
+usage(void)
 {
 	printf(
 		"usage: ogr_fdw_info -s <ogr datasource> -l <ogr layer name> -i <ogr layer index (numeric)> -t <output table name> -n <output server name> -o <config options>\n"
@@ -294,7 +298,7 @@ ogrGenerateSQL(const char* server, const char* layer, const char* table, const c
 	if (! ogr_dr)
 		ogr_dr = GDALGetDatasetDriver(ogr_ds);
 
-	strcpy(server_name, server == NULL ? "myserver" : server);
+	strlcpy(server_name, server == NULL ? "myserver" : server, sizeof(server_name));
 
 	if (options != NULL) {
 		char *p;
@@ -302,7 +306,7 @@ ogrGenerateSQL(const char* server, const char* layer, const char* table, const c
 		char option[NAMEDATALEN];
 		const char *short_name = GDALGetDriverShortName(ogr_dr);
 
-		strncpy(stripped_config_options, options, STR_MAX_LEN - 1);
+		strlcpy(stripped_config_options, options, STR_MAX_LEN - 1);
 		p = strtok(strip_spaces(stripped_config_options), ",");
 
 		while (p != NULL) {



View it on GitLab: https://salsa.debian.org/debian-gis-team/pgsql-ogr-fdw/-/commit/b747e83127b0502486ffa449fd52a2716e8b3c96

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pgsql-ogr-fdw/-/commit/b747e83127b0502486ffa449fd52a2716e8b3c96
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20260616/3ec0ac48/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list