[GRASS-SVN] r67411 - grass/branches/releasebranch_7_0/scripts/v.db.join

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 29 01:24:41 PST 2015


Author: martinl
Date: 2015-12-29 01:24:41 -0800 (Tue, 29 Dec 2015)
New Revision: 67411

Modified:
   grass/branches/releasebranch_7_0/scripts/v.db.join/v.db.join.py
Log:
v.db.join: fix db.describe and mysql (#2792)
           (merge r67376:67377 from trunk)


Modified: grass/branches/releasebranch_7_0/scripts/v.db.join/v.db.join.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/v.db.join/v.db.join.py	2015-12-29 09:19:56 UTC (rev 67410)
+++ grass/branches/releasebranch_7_0/scripts/v.db.join/v.db.join.py	2015-12-29 09:24:41 UTC (rev 67411)
@@ -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_len = False
+	if len(col) > 2:
+            use_len = True
+            # Sqlite 3 does not support the precision number any more
+            if driver == "sqlite":
+                use_len = False
+            # MySQL - expect format DOUBLE PRECISION(M,D), see #2792
+            elif driver == "mysql" and col[1] == 'DOUBLE PRECISION':
+                use_len = False
+        
+        if use_len:
 	    coltype = "%s(%s)" % (col[1], col[2])
 	else:
 	    coltype = "%s" % col[1]



More information about the grass-commit mailing list