Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-461

Server-side prepared results can cause crashes

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.2.4
    • 3.2.6
    • General
    • None

    Description

      Server side prepared results can cause crashes of the ODBC driver.

      The problem is, that the destructor of `ServerPrepareResult::~ServerPrepareResult` calls the function `forceReleasePrepareStatement` link .

      This functions defintion link can throw an exception, either when the connection is lost or when there are still pending results in the queue (Error code `CR_COMMANDS_OUT_OF_SYNC`). See `mysql_stmt_close` for reason, when and why the exception will be thrown.

      Not handling the exception inside the destructor leads to a crash. A simple catch and ignore of the exception is possible in case of connection lost. But for the case, that `mysql_stmt_close` sets `CR_COMMANDS_OUT_OF_SYNC` as error, ignoring the exception will lead to a minor memory leak.

      Unfortunately, I am currently not sure how the fix should look like. But there should be preventions for letting the destructor throw an exception.

      edit: formatting

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            mmoel Matthias Möller
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.