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

cursor.scroll() issues



    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 0.9.53
    • Documentation
    • None


      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).




            georg Georg Richter
            WayneD Wayne Davison (Inactive)
            0 Vote for this issue
            2 Start watching this issue



              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.