[GRASS-SVN] r73035 - grass/trunk/db/drivers/ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 3 07:54:23 PDT 2018


Author: mmetz
Date: 2018-08-03 07:54:23 -0700 (Fri, 03 Aug 2018)
New Revision: 73035

Modified:
   grass/trunk/db/drivers/ogr/describe.c
Log:
ogr driver: use DB_SQL_TYPE_TEXT as column type when appropriate

Modified: grass/trunk/db/drivers/ogr/describe.c
===================================================================
--- grass/trunk/db/drivers/ogr/describe.c	2018-08-03 14:51:58 UTC (rev 73034)
+++ grass/trunk/db/drivers/ogr/describe.c	2018-08-03 14:54:23 UTC (rev 73035)
@@ -198,13 +198,13 @@
 	case OFTDate:
 	case OFTTime:
 	case OFTDateTime:
-	    sqlType = DB_SQL_TYPE_CHARACTER;
-	    size = OGR_Fld_GetWidth(hFieldDefn);
-	    if (size == 0) {
-		G_warning(_("column '%s', type 'string': unknown width -> stored as varchar(250) "
-			   "some data may be lost"), fieldName);
-		size = 250;
+	    size = OGR_Fld_GetWidth(hFieldDefn)
+	    if (size > 0) {
+		sqlType = DB_SQL_TYPE_CHARACTER;
 	    }
+	    else {
+		sqlType = DB_SQL_TYPE_TEXT;
+	    }
 	    precision = 0;
 	    break;
 



More information about the grass-commit mailing list