[GRASS-dev] [GRASS GIS] #2792: db.describe and mysql

GRASS GIS trac at osgeo.org
Thu Nov 5 22:55:41 PST 2015


#2792: db.describe and mysql
----------------------+-------------------------
 Reporter:  fpouw     |      Owner:  grass-dev@…
     Type:  defect    |     Status:  new
 Priority:  normal    |  Milestone:
Component:  Database  |    Version:  7.0.0
 Keywords:            |        CPU:  x86-64
 Platform:  Linux     |
----------------------+-------------------------
 A query result form this component causes v.db.addcolumn and
 (consequently) v.db.join to fail.

 db.describe reports the mysql "double" tables as

 column:cat
 description:
 type:DOUBLE PRECISION
 len:22
 scale:0
 precision:31
 default:
 nullok:yes
 select:?
 update:?

 When the len value (e.g. 22) is then used by the v.db.join function (which
 calls v.db.addcolumn), the process fails in the execution of the mysql
 command:

   ALTER TABLE <table_name> ADD COLUMN <column_name> DOUBLE PRECISION(22)

 This is because mysql expect the format: ...DOUBLE PRECISION(M,D).

 "Here, “(M,D)” means than values can be stored with up to M digits in
 total, of which D digits may be after the decimal point." from:
 http://dev.mysql.com/doc/refman/5.7/en/floating-point-types.html

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2792>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list