[GRASS-user] v.in.db accept DECIMAL'S?

Markus Neteler neteler at osgeo.org
Tue Apr 7 03:25:25 EDT 2009


On Tue, Apr 7, 2009 at 12:47 AM, Jhon Ortiz <eljhonjhon at hotmail.com> wrote:
> Hi all,
>
> I'm trying to create a new vector (points) map from a mysql database table
>
> v.in.db --overwrite table=data_wells driver=mysql
> database="host=localhost,dbname=Eoceno" x=Este y=Norte z=Salinity_Index
> key=Cat output=Pozos
>
> but I get this error:
>
> WARNING: MySQL driver: column 'Salinity_Index', type 246 is not supported


I have searched that and found

grep 246 /usr/include/mysql/mysql_com.h
                        MYSQL_TYPE_NEWDECIMAL=246,

I suspect that this change is sufficient to solve the problem:
--- db/drivers/mysql/describe.c (revision 36267)
+++ db/drivers/mysql/describe.c (working copy)
@@ -177,6 +177,7 @@
        break;

     case MYSQL_TYPE_DECIMAL:
+    case MYSQL_TYPE_NEWDECIMAL:
        *sqltype = DB_SQL_TYPE_DECIMAL;
        break;

Do you have a possibility to compile and test?

Markus


More information about the grass-user mailing list