[GRASS-SVN] r70260 - in grass/branches/releasebranch_7_2/db/drivers: ogr postgres

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 5 03:08:45 PST 2017


Author: martinl
Date: 2017-01-05 03:08:45 -0800 (Thu, 05 Jan 2017)
New Revision: 70260

Modified:
   grass/branches/releasebranch_7_2/db/drivers/ogr/describe.c
   grass/branches/releasebranch_7_2/db/drivers/postgres/describe.c
Log:
ogr dbdriver: support OFTInteger64 (merge r70259 from trunk)

Modified: grass/branches/releasebranch_7_2/db/drivers/ogr/describe.c
===================================================================
--- grass/branches/releasebranch_7_2/db/drivers/ogr/describe.c	2017-01-05 11:06:40 UTC (rev 70259)
+++ grass/branches/releasebranch_7_2/db/drivers/ogr/describe.c	2017-01-05 11:08:45 UTC (rev 70260)
@@ -106,7 +106,7 @@
 	ogrType = OGR_Fld_GetType(hFieldDefn);
 	fieldName = OGR_Fld_GetNameRef(hFieldDefn);
 
-	if (ogrType != OFTInteger && ogrType != OFTReal &&
+	if (ogrType != OFTInteger && ogrType != OFTInteger64 && ogrType != OFTReal &&
 	    ogrType != OFTString  && ogrType != OFTDate &&
 	    ogrType != OFTTime    && ogrType != OFTDateTime ) {
 	    G_warning(_("OGR driver: column '%s', OGR type %d is not supported"),
@@ -171,9 +171,13 @@
 
 	switch (ogrType) {
 	case OFTInteger:
+        case OFTInteger64:
 	    sqlType = DB_SQL_TYPE_INTEGER;
 	    size = OGR_Fld_GetWidth(hFieldDefn);	/* OK ? */
 	    precision = 0;
+            if (ogrType == OFTInteger64)
+                G_warning(_("Column '%s' : type int8 (bigint) is stored as integer (4 bytes) "
+                            "some data may be damaged"), fieldName);
 	    break;
 
 	case OFTReal:

Modified: grass/branches/releasebranch_7_2/db/drivers/postgres/describe.c
===================================================================
--- grass/branches/releasebranch_7_2/db/drivers/postgres/describe.c	2017-01-05 11:06:40 UTC (rev 70259)
+++ grass/branches/releasebranch_7_2/db/drivers/postgres/describe.c	2017-01-05 11:08:45 UTC (rev 70260)
@@ -127,11 +127,11 @@
 	}
 
 	if (gpgtype == PG_TYPE_INT8)
-	    G_warning(_("column '%s' : type int8 (bigint) is stored as integer (4 bytes) "
+	    G_warning(_("Column '%s' : type int8 (bigint) is stored as integer (4 bytes) "
 		       "some data may be damaged"), fname);
 
 	if (gpgtype == PG_TYPE_VARCHAR && fsize < 0) {
-	    G_warning(_("column '%s' : type character varying is stored as varchar(250) "
+	    G_warning(_("Column '%s' : type character varying is stored as varchar(250) "
 		       "some data may be lost"), fname);
 	    fsize = 250;
 	}



More information about the grass-commit mailing list