Opened 2 years ago

Closed 2 years ago

#5179 closed defect (fixed)

error: expected ‘)’ before ‘quote_identifier’

Reported by: sebastic Owned by: robe
Priority: high Milestone: PostGIS 3.3.0
Component: utils/loader-dumper Version: master
Keywords: Cc:

Description

The Debian package build for PostGIS 3.3.0beta1 failed on 390x (big endian):

make[3]: Entering directory '/<<PKGBUILDDIR>>/loader'
s390x-linux-gnu-gcc -I../liblwgeom -I../liblwgeom  -I/usr/include -I/usr/include/s390x-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fno-math-errno -fno-signed-zeros -Wall -flto  -fPIC -DPIC -I/usr/include/s390x-linux-gnu   -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o shpopen.o shpopen.c
s390x-linux-gnu-gcc -I../liblwgeom -I../liblwgeom  -I/usr/include -I/usr/include/s390x-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fno-math-errno -fno-signed-zeros -Wall -flto  -fPIC -DPIC -I/usr/include/s390x-linux-gnu   -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o dbfopen.o dbfopen.c
s390x-linux-gnu-gcc -I../liblwgeom -I../liblwgeom  -I/usr/include -I/usr/include/s390x-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fno-math-errno -fno-signed-zeros -Wall -flto  -fPIC -DPIC -I/usr/include/s390x-linux-gnu   -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o getopt.o getopt.c
s390x-linux-gnu-gcc -I../liblwgeom -I../liblwgeom  -I/usr/include -I/usr/include/s390x-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fno-math-errno -fno-signed-zeros -Wall -flto  -fPIC -DPIC -I/usr/include/s390x-linux-gnu   -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o shpcommon.o shpcommon.c
s390x-linux-gnu-gcc -I../liblwgeom -I../liblwgeom  -I/usr/include -I/usr/include/s390x-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fno-math-errno -fno-signed-zeros -Wall -flto  -fPIC -DPIC -I/usr/include/s390x-linux-gnu   -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o safileio.o safileio.c
s390x-linux-gnu-gcc -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I../liblwgeom -I../liblwgeom  -I/usr/include -I/usr/include/s390x-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fno-math-errno -fno-signed-zeros -Wall -flto  -fPIC -DPIC -I/usr/include/s390x-linux-gnu   -c shp2pgsql-core.c
s390x-linux-gnu-gcc -I../liblwgeom -I../liblwgeom  -I/usr/include -I/usr/include/s390x-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fno-math-errno -fno-signed-zeros -Wall -flto  -fPIC -DPIC -I/usr/include/s390x-linux-gnu   -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o shp2pgsql-cli.o shp2pgsql-cli.c
s390x-linux-gnu-gcc -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I../liblwgeom -I../liblwgeom  -I/usr/include -I/usr/include/s390x-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fno-math-errno -fno-signed-zeros -Wall -flto  -fPIC -DPIC -I/usr/include/s390x-linux-gnu   -I/usr/include/postgresql -c pgsql2shp-core.c
s390x-linux-gnu-gcc -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I../liblwgeom -I../liblwgeom  -I/usr/include -I/usr/include/s390x-linux-gnu  -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fno-math-errno -fno-signed-zeros -Wall -flto  -fPIC -DPIC -I/usr/include/s390x-linux-gnu   -I/usr/include/postgresql -c pgsql2shp-cli.c
pgsql2shp-core.c: In function ‘ShpDumperOpenTable’:
pgsql2shp-core.c:1860:85: error: expected ‘)’ before ‘quote_identifier’
 1860 |                             "ST_asEWKB(ST_SetSRID(%s::geometry, 0), 'XDR') AS _geoX"
      |                                                                                     ^
      |                                                                                     )
 1861 |                             quote_identifier(state->geo_col_name) );
      |                             ~~~~~~~~~~~~~~~~                                         
pgsql2shp-core.c:1859:45: note: to match this ‘(’
 1859 |                         stringbuffer_aprintf(&sb,
      |                                             ^
make[3]: *** [Makefile:104: pgsql2shp-core.o] Error 1

Full buildlog

Change History (3)

comment:1 by sebastic, 2 years ago

This fixes the issue:

--- a/loader/pgsql2shp-core.c
+++ b/loader/pgsql2shp-core.c
@@ -1857,7 +1857,7 @@ ShpDumperOpenTable(SHPDUMPERSTATE *state)
 #ifdef WORDS_BIGENDIAN
                if (state->pgis_major_version > 0) {
                        stringbuffer_aprintf(&sb,
-                           "ST_asEWKB(ST_SetSRID(%s::geometry, 0), 'XDR') AS _geoX"
+                           "ST_asEWKB(ST_SetSRID(%s::geometry, 0), 'XDR') AS _geoX",
                            quote_identifier(state->geo_col_name) );
                }
                else
Last edited 2 years ago by sebastic (previous) (diff)

comment:3 by Regina Obe <lr@…>, 2 years ago

Resolution: fixed
Status: newclosed

In 889aaa6/git:

Fix build failure on s390x.
Closes #5179
Fixes: https://trac.osgeo.org/postgis/ticket/5179

Note: See TracTickets for help on using tickets.