[R] RMySQL fetch defaults to N=500?

Jens Nieschulze jniesch at gwdg.de
Fri Aug 9 08:40:52 CEST 2002

On Thu, 8 Aug 2002, Jay Pfaffman wrote:

%It appears that fetch() gets only the first 500 rows by default.  I
%don't see this in the documentation, but 

it is not in ?fetch
> describe(manager)
MySQLManager id = (5649) 
  Driver name:  MySQL 
  Max  connections: 10 
  Conn. processed: 1 
  Default records per fetch: 500 
  Open connections: 1 

where manager is your the output of dbManager("MySQL")
reveals some info

%    timeinfo <- fetch(rs)
%gets only 500 rows where
%    timeinfo <- fetch(rs,n=-1)
%gets (correctly) 736 for the same query.  Is this an undocumented
%feature?  I played with this data for an alarming amount of time
%before I realized that I was missing a third of the data.  I appear to
%be using version 0.4-5.  I'll upgrade to 0.4-6 Real Soon Now.  My
%first attempt failed for some reason.

undocumented? err, you can always look up the sources and in 
RMySQL.R (version 04-6)  this feature is documented 

line 647 
"MySQLManager" <- 
function(max.con=10, fetch.default.rec = 500, force.reload=F)

line 1400
"fetch.MySQLResultSet" <- 
function(res, n=0)   
## Fetch at most n records from the opened resultSet (n = -1 means
## all records, n=0 means extract as many as "default_fetch_rec",
## as defined by MySQLManager (see describe(mgr, T)).


%Jay Pfaffman                           pfaffman at relaxpc.com
%+1-415-821-7507 (H)                    +1-415-810-2238 (M)
%r-help 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-help-request at stat.math.ethz.ch

Jens Nieschulze

Institute for Forest Biometrics &	Phone: ++49-551-39-12107
Applied Computer Science		Fax  : ++49-551-39-3465
Buesgenweg 4
37077 Goettingen		E-mail: jniesch at uni-forst.gwdg.de
GERMANY				http://www.uni-forst.gwdg.de/~jniesch

r-help 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-help-request at stat.math.ethz.ch

More information about the R-help mailing list