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

#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&gt;
GRASS GIS <https://grass.osgeo.org>

#2792: db.describe and mysql
-----------------------+--------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.0
Resolution: | Keywords: db.describe, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+--------------------------------
Changes (by neteler):

* keywords: => db.describe, mysql
* milestone: => 7.0.3

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2792#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#2792: db.describe and mysql
-----------------------+--------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.0
Resolution: | Keywords: db.describe, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+--------------------------------

Comment (by martinl):

Attempt to fix this issue in r67376.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2792#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#2792: db.describe and mysql
-----------------------+--------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.0
Resolution: | Keywords: db.describe, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+--------------------------------

Comment (by martinl):

Backported in r67411. Closing the ticket feel free to re-open if needed.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2792#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#2792: db.describe and mysql
-----------------------+--------------------------------
  Reporter: fpouw | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.3
Component: Database | Version: 7.0.0
Resolution: fixed | Keywords: db.describe, mysql
       CPU: x86-64 | Platform: Linux
-----------------------+--------------------------------
Changes (by martinl):

* status: new => closed
* resolution: => fixed

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2792#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>