[GRASS-SVN] r70261 - in grass/branches/releasebranch_7_0/db/drivers: ogr postgres

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 5 03:10:21 PST 2017


Author: martinl
Date: 2017-01-05 03:10:21 -0800 (Thu, 05 Jan 2017)
New Revision: 70261

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

Modified: grass/branches/releasebranch_7_0/db/drivers/ogr/describe.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/ogr/describe.c	2017-01-05 11:08:45 UTC (rev 70260)
+++ grass/branches/releasebranch_7_0/db/drivers/ogr/describe.c	2017-01-05 11:10:21 UTC (rev 70261)
@@ -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_0/db/drivers/postgres/describe.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/postgres/describe.c	2017-01-05 11:08:45 UTC (rev 70260)
+++ grass/branches/releasebranch_7_0/db/drivers/postgres/describe.c	2017-01-05 11:10:21 UTC (rev 70261)
@@ -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