[GRASS-SVN] r67376 - grass/trunk/scripts/v.db.join

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 25 12:40:10 PST 2015


Author: martinl
Date: 2015-12-25 12:40:10 -0800 (Fri, 25 Dec 2015)
New Revision: 67376

Modified:
   grass/trunk/scripts/v.db.join/v.db.join.py
Log:
v.db.join: fix db.describe and mysql (#2792)


Modified: grass/trunk/scripts/v.db.join/v.db.join.py
===================================================================
--- grass/trunk/scripts/v.db.join/v.db.join.py	2015-12-25 19:52:31 UTC (rev 67375)
+++ grass/trunk/scripts/v.db.join/v.db.join.py	2015-12-25 20:40:10 UTC (rev 67376)
@@ -123,8 +123,18 @@
 	colname = col[0]
 	if colname == column:
 	    continue
-	# Sqlite 3 does not support the precision number any more
-	if len(col) > 2 and driver != "sqlite":
+        
+        use_precision = False
+	if len(col) > 2:
+            use_precision = True
+            # Sqlite 3 does not support the precision number any more
+            if driver == "sqlite":
+                use_precision = False
+            # MySQL - expect format DOUBLE PRECISION(M,D), see #2792
+            elif driver == "mysql" and col[1] == 'DOUBLE PRECISION':
+                use_precision = False
+        
+        if use_precision:
 	    coltype = "%s(%s)" % (col[1], col[2])
 	else:
 	    coltype = "%s" % col[1]



More information about the grass-commit mailing list