[Rd] RMySQL integer range bug (PR#1400)

matthias.piksa@web.de matthias.piksa@web.de
Wed, 20 Mar 2002 13:41:38 +0100 (MET)


Full_Name: Matthias Piksa
Version: 1.4.1
OS: Redhat 7.1 2.96-85
Submission from: (NULL) (131.220.6.43)


There is a bug when retrieving values out of MySQL (3.23.36) which are of type
UNSIGNED INTEGER(10). The values can vary between 0 and 2^32 but R only accepts
those below 2^31-1. Anything above goes as 2^31-1.

thats what one gets:
print(quickSQL(con,"select ip_dst from iphdr where ip_dst>=2212233216 limit
5"))
      ip_dst
1 2147483647
2 2147483647
3 2147483647
4 2147483647
5 2147483647

and thats what the numbers really are (conversion to character type first):
print(quickSQL(con,"select concat(ip_dst) from iphdr where ip_dst>=2212233216
limit 5"))
  concat(ip_dst)
1     2212234077
2     2212234085
3     2212234085
4     2212234085
5     2212234086

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._