Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#38 wrong default for cursor.arraysize

MySQLdb-0.9.2
closed
Andy Dustman
5
2012-09-19
2002-07-28
Gerhard Häring
No

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.

Discussion

  • Andy Dustman
    Andy Dustman
    2002-07-30

    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.