Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 0.9.52
    • 0.9.53
    • DBAPI 2.0
    • None

    Description

      I created a cursor as follows:

      cursor = conn.cursor(cursor_type=mariadb.CURSOR_TYPE_READ_ONLY)

      And then used the cursor to execute a few INSERT statements. Following those, an attempt to do a SELECT caused a segmentation fault.

      If I avoid the INSERT statements, the SELECT works fine with CURSOR_TYPE_READ_ONLY set.

      Attachments

        Activity

          georg Georg Richter added a comment -

          Hi,

          I cannot reproduce this issue. Can you please provide an example?

          georg Georg Richter added a comment - Hi, I cannot reproduce this issue. Can you please provide an example?
          WayneD Wayne Davison (Inactive) added a comment - - edited

          Attached! When I run it (server 10.4.11-5) I see ever-increasing id numbers for the newly added records and then a segfault. For example:

          10 foo
          11 bar
          12 baz
          [1] 4802 segmentation fault (core dumped) ./non-read-only.py

          WayneD Wayne Davison (Inactive) added a comment - - edited Attached! When I run it (server 10.4.11-5) I see ever-increasing id numbers for the newly added records and then a segfault. For example: 10 foo 11 bar 12 baz [1] 4802 segmentation fault (core dumped) ./non-read-only.py
          georg Georg Richter added a comment -

          Thanks for the the reproducible test case. The crash happens in Connector/C, not in the python connector it self.

          It looks like we need to support the read only cursor type parameter in execute only, but not when creating the cursor object. Latter one requires more detailed parsing of the SQL statement, which will be expensive.

          georg Georg Richter added a comment - Thanks for the the reproducible test case. The crash happens in Connector/C, not in the python connector it self. It looks like we need to support the read only cursor type parameter in execute only, but not when creating the cursor object. Latter one requires more detailed parsing of the SQL statement, which will be expensive.
          georg Georg Richter added a comment -

          Fixed. rev. 26fa254e119fe75f4c1ea6f43ba605804fed4323

          georg Georg Richter added a comment - Fixed. rev. 26fa254e119fe75f4c1ea6f43ba605804fed4323

          I see that the segmentation fault is now fixed, but the inserts are still allowed to happen.

          WayneD Wayne Davison (Inactive) added a comment - I see that the segmentation fault is now fixed, but the inserts are still allowed to happen.

          People

            georg Georg Richter
            WayneD Wayne Davison (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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