Browse Source

v.db.join: fix db.describe and mysql (https://trac.osgeo.org/grass/ticket/2792)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67376 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 years ago
parent
commit
14449caa32
1 changed files with 12 additions and 2 deletions
  1. 12 2
      scripts/v.db.join/v.db.join.py

+ 12 - 2
scripts/v.db.join/v.db.join.py

@@ -123,8 +123,18 @@ def main():
 	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]