Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-38

cursor.scroll() issues

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None

      Description

      The absolute scroll() positioning seems to be off by one – if I use cursor.scroll(1, 'absolute') and grab the row using cursor.fetchone(), it give me the second row, not the first. Trying to use cursor.scroll(0) rejects the value as invalid, so it looks like the absolute values are supposed to be 1-relative. UPDATE: I looked at the git logs, and it looks like scroll(0) was made to work, so I guess the issue is that pip3 doesn't install a new enough version and I'm complaining about old code.

      The source/cursor.rst file says that scroll() defaults to absolute, but it really defaults to relative (as the PyDOC states).

      It looks like I must use a "buffered=True" clause on the execute() for scroll to work. I tried setting buffered=True on the cursor creation prior to the execute(), but it failed with:

      mariadb.ProgrammingError: This method is available only for cursors with buffered result set or a read only cursor type

      I also tried setting the cursor to read-only. e.g. various combos of these options:

      cursor = conn.cursor(buffered=True, cursor_type=mariadb.CURSOR_TYPE_READ_ONLY)

      ... but I could only get it to work with cursor.execute("SELECT ...", buffered=True).

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            WayneD Wayne Davison
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: