[R-sig-DB] Help with RMySQL warning message "Decimal MySQL column 1 imported as numeric"

MacQueen, Don m@cqueen1 @end|ng |rom ||n|@gov
Thu May 21 20:39:12 CEST 2015


I recently upgraded to R 3.2.0 on a linux box (not my main machine), and
then installed RMySQL. I now get the following warning messages from
RMySQL that I had not previously.

> dbm <- MySQL()
> con <- dbConnect(dbm, {other args})
> bah <- dbGetQuery(con, 'select * from gms order by sord')
Warning messages:
1: In .local(conn, statement, ...) :
  Decimal MySQL column 1 imported as numeric
2: In .local(conn, statement, ...) :
  Decimal MySQL column 2 imported as numeric

For the table in question

mysql> describe gms;
+--------------+---------------+------+-----+---------+-------+
| Field        | Type          | Null | Key | Default | Extra |
+--------------+---------------+------+-----+---------+-------+
| sens         | varchar(10)   | NO   | PRI |         |       |
| latitude     | decimal(15,9) | YES  |     | NULL    |       |
| longitude    | decimal(15,9) | YES  |     | NULL    |       |
| northing     | float         | NO   |     | NULL    |       |
| easting      | float         | NO   |     | NULL    |       |
| direction    | varchar(15)   | YES  |     | NULL    |       |
| sord         | int(11)       | YES  |     | NULL    |       |
+--------------+---------------+------+-----+---------+-------+


I suspect the latitude and longitude fields are responsible for the
warnings.



This all happens within a script run as a frequent cron job, with the
result that the warning messages cause cron to send me many emails.


Of course, I can wrap the expression in suppressWarnings(), but I would
prefer if possible to handle this by telling dbGetQuery that this
conversion really is ok and I don't need a warning. Is this possible?


Further version information:

With R 3.2.0 I have RMySQL and DBI versions 0.10.3 and 0.3.1 respectively.
Previously, with R 3.1.2, it was 0.9-3 and 0.3.1 respectively.

I can supply sessionInfo() if needed.

If it helps, the same warnings are generated by dbSendQuery() and
dbReadTable()


I have spent some time with the help pages, looked at RMySQL.pdf, without
success.

Thanks
-Don


-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062




More information about the R-sig-DB mailing list