]> granicus.if.org Git - postgis/commitdiff
#3048, shp2pgsql - illegal number format when specific system locale set
authorPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 23 Apr 2015 19:36:10 +0000 (19:36 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 23 Apr 2015 19:36:10 +0000 (19:36 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13439 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
loader/shp2pgsql-core.c

diff --git a/NEWS b/NEWS
index 457eca20199160f99be7d4c19e1a9b1eea460fb7..68f1bdaf8842236a3b0a541888efc58da3d5dc70 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -92,11 +92,12 @@ PostGIS 2.2.0
            like geometry extent
   - #2822, Use @ operator instead of ST_CoveredBy() for raster
            max extent constraint
+  - #3018, GROUP BY geography sometimes returns duplicate rows
   - #3020, ST_AddBand out-db bug where height using width value
+  - #3048, shp2pgsql - illegal number format when specific system locale set
   - #3061, Allow duplicate points in JSON, GML, GML ST_GeomFrom* functions
   - #3086, ST_DumpValues() crashes backend on cleanup with invalid
            band indexes
-  - #3018, GROUP BY geography sometimes returns duplicate rows
 
  * Code refactoring *
 
index b16c3dfc621d753bf04f53c84c25aac7f2bc434d..47f5202c9993a803970cfcfd739cc3c96caa7468 100644 (file)
@@ -1793,6 +1793,9 @@ ShpLoaderGenerateSQLRowStatement(SHPLOADERSTATE *state, int item, char **strreco
        /* Add the shape attribute if we are reading it */
        if (state->config->readshape == 1)
        {
+               /* Force the locale to C */
+               char *oldlocale = setlocale(LC_NUMERIC, "C");
+               
                /* Handle the case of a NULL shape */
                if (obj->nVertices == 0)
                {
@@ -1885,6 +1888,8 @@ ShpLoaderGenerateSQLRowStatement(SHPLOADERSTATE *state, int item, char **strreco
 
                /* Tidy up everything */
                SHPDestroyObject(obj);
+               
+               setlocale(LC_NUMERIC, oldlocale);
        }
 
        /* Close the line correctly for dump/insert format */