Menu

#38 wrong default for cursor.arraysize

MySQLdb-0.9.2
closed
5
2012-09-19
2002-07-28
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.

     
  • Gerhard Häring

    Gerhard Häring - 2002-07-30

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.