[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.7-21-gfe5eb4f54
git at osgeo.org
git at osgeo.org
Thu Nov 3 17:58:28 PDT 2022
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, stable-3.1 has been updated
via fe5eb4f5421b753292f74d2f0dc3533387f012b9 (commit)
via 96e0a45b0337440851d3021ac548d2019f725c3b (commit)
via 46a077bedf023aee55d59b742d9ea52ad8146e57 (commit)
from 61bb7f64760a91b2f1c576e096106c0532705a26 (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 fe5eb4f5421b753292f74d2f0dc3533387f012b9
Author: Regina Obe <lr at pcorp.us>
Date: Thu Nov 3 20:58:22 2022 -0400
NEWS for 3.1.8 References #5280
diff --git a/NEWS b/NEWS
index 7b114b272..20ba00c1c 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ YYYY/MM/DD
- #4648, Check function ownership at extension packaging time (Sandro Santilli)
- #5241, Crash on ST_SnapToGrid with empty multis (Regina Obe)
- #5234, Fix 2.5d topology building regression (Sandro Santilli)
+ - #5280, Handle load of dbase character fields with no width specified (Regina Obe)
PostGIS 3.1.7
2022/08/18
commit 96e0a45b0337440851d3021ac548d2019f725c3b
Author: Regina Obe <lr at pcorp.us>
Date: Thu Nov 3 20:55:58 2022 -0400
Handle load of dbase character fields with no width specified
References #5280 for PostGIS 3.1.8
diff --git a/loader/shp2pgsql-core.c b/loader/shp2pgsql-core.c
index b6963cdb1..4c0cbf924 100644
--- a/loader/shp2pgsql-core.c
+++ b/loader/shp2pgsql-core.c
@@ -1362,9 +1362,10 @@ ShpLoaderGetSQLHeader(SHPLOADERSTATE *state, char **strheader)
/* First output the raw field type string */
stringbuffer_aprintf(sb, "%s", state->pgfieldtypes[j]);
- /* Some types do have typmods though... */
- if (!strcmp("varchar", state->pgfieldtypes[j]))
- stringbuffer_aprintf(sb, "(%d)", state->widths[j]);
+ /* Some types do have typmods */
+ /* Apply width typmod for varchar if there is positive width **/
+ if (!strcmp("varchar", state->pgfieldtypes[j]) && state->widths[j] > 0)
+ stringbuffer_aprintf(sb, "(%d)", state->widths[j]);
if (!strcmp("numeric", state->pgfieldtypes[j]))
{
diff --git a/regress/loader/CharNoWidth.dbf b/regress/loader/CharNoWidth.dbf
new file mode 100644
index 000000000..9edcc7d04
Binary files /dev/null and b/regress/loader/CharNoWidth.dbf differ
diff --git a/regress/loader/CharNoWidth.select.expected b/regress/loader/CharNoWidth.select.expected
new file mode 100644
index 000000000..3cd81d490
--- /dev/null
+++ b/regress/loader/CharNoWidth.select.expected
@@ -0,0 +1,18 @@
+1|11|50000|02390665|1150000|Washington|Washington city|25|C5|||G4110|N|158316184|18709787|+38.9042474|-077.0165167
+aland|
+awater|
+classfp|2
+funcstat|1
+geoid|7
+gid|
+intptlat|11
+intptlon|12
+lsad|2
+mtfcc|5
+name|100
+namelsad|100
+pcicbsa|
+pcinecta|
+placefp|5
+placens|8
+statefp|2
diff --git a/regress/loader/CharNoWidth.select.sql b/regress/loader/CharNoWidth.select.sql
new file mode 100644
index 000000000..c7ccb2e01
--- /dev/null
+++ b/regress/loader/CharNoWidth.select.sql
@@ -0,0 +1,3 @@
+SET CLIENT_ENCODING to UTF8;
+SELECT * FROM loadedshp;
+SELECT column_name, character_maximum_length FROM information_schema.columns WHERE table_name = 'loadedshp' ORDER BY column_name;
diff --git a/regress/loader/tests.mk b/regress/loader/tests.mk
index 85031b7eb..abbb45ab4 100644
--- a/regress/loader/tests.mk
+++ b/regress/loader/tests.mk
@@ -37,4 +37,5 @@ TESTS += \
$(topsrcdir)/regress/loader/ReprojectPtsGeogD \
$(topsrcdir)/regress/loader/Latin1 \
$(topsrcdir)/regress/loader/Latin1-implicit \
- $(topsrcdir)/regress/loader/mfile
+ $(topsrcdir)/regress/loader/mfile \
+ $(topsrcdir)/regress/loader/CharNoWidth
commit 46a077bedf023aee55d59b742d9ea52ad8146e57
Author: Regina Obe <lr at pcorp.us>
Date: Thu Nov 3 20:52:36 2022 -0400
Berries change to test geos 3.10.4 (stable-3.10)
diff --git a/ci/berrie/configs.sh b/ci/berrie/configs.sh
index a2fb02288..b7fecc12a 100644
--- a/ci/berrie/configs.sh
+++ b/ci/berrie/configs.sh
@@ -1,5 +1,5 @@
export WORKSPACE=/home/jenkins/workspace
-export GEOS_VER=3.10.3
+export GEOS_VER=3.10.4
export OS_BUILD=32
export PG_VER=14
diff --git a/ci/berrie64/configs.sh b/ci/berrie64/configs.sh
index c4f752cc0..2377d8536 100644
--- a/ci/berrie64/configs.sh
+++ b/ci/berrie64/configs.sh
@@ -1,5 +1,5 @@
export WORKSPACE=/home/jenkins/workspace
-export GEOS_VER=3.10.3
+export GEOS_VER=3.10.4
export OS_BUILD=64
export PG_VER=14
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
ci/berrie/configs.sh | 2 +-
ci/berrie64/configs.sh | 2 +-
loader/shp2pgsql-core.c | 7 ++++---
regress/loader/CharNoWidth.dbf | Bin 0 -> 830 bytes
regress/loader/CharNoWidth.select.expected | 18 ++++++++++++++++++
regress/loader/CharNoWidth.select.sql | 3 +++
regress/loader/tests.mk | 3 ++-
8 files changed, 30 insertions(+), 6 deletions(-)
create mode 100644 regress/loader/CharNoWidth.dbf
create mode 100644 regress/loader/CharNoWidth.select.expected
create mode 100644 regress/loader/CharNoWidth.select.sql
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list