wrong default for cursor.arraysize
MySQL database connector for Python programming
Brought to you by:
adustman
In 0.9.2c3, cursor.arraysize has a default of 100. But
the DB-API 2.0 spec in PEP 0249 says
<quote>
.arraysize
This read/write attribute specifies the
number of rows to
fetch at a time with fetchmany(). It
defaults to 1 meaning
to fetch a single row at a time.
</quote>
It'd be a very simple fix in the BaseCursor
constructor, but backward incompatible if people relied
on this behaviour.
Logged In: YES
user_id=71372
I've been aware of this specified limit for some time, and I
think 1 is a dumb default limit. Nobody's ever going to use
that as a default; they're always going to either supply the
number of rows to return as an argument or else override the
default. At least 100 gives a reasonable number of rows.
I'm probably not going to change this without a more
compelling reason.
Logged In: YES
user_id=163326
That's ok with me. I only became aware of it because
somebody asked about why pyPgSQL and MySQLdb had different
defaults on the python-de mailing list. Just wanted to let
you know in case you weren't aware of it.
Personally, I always use fetchmany with an explict argument,
anyway.