Opened 9 years ago

Closed 9 years ago

#2792 closed defect (fixed)

db.describe and mysql

Reported by: fpouw Owned by: grass-dev@…
Priority: normal Milestone: 7.0.3
Component: Database Version: 7.0.0
Keywords: db.describe, mysql Cc:
CPU: x86-64 Platform: Linux

Description

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

Change History (4)

comment:1 by neteler, 9 years ago

Keywords: db.describe mysql added
Milestone: 7.0.3

comment:2 by martinl, 9 years ago

Attempt to fix this issue in r67376.

comment:3 by martinl, 9 years ago

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

comment:4 by martinl, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.