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

Tansaction Isolation Level is not applied if set before connect

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.1.19
    • 3.2.1, 3.1.20
    • General
    • None

    Description

      Specs allow SQL_ATTR_TXN_ISOLATION connection attribute to be set before connection, but if application does that, the driver won't apply it to the established connection.

      The code for illustration

      SQLAllocHandle(SQL_HANDLE_DBC, Env, dbc);
      CHECK_DBC_RC(dbc, SQLSetConnectAttr(dbc, SQL_ATTR_TXN_ISOLATION,
          (SQLPOINTER)SQL_TXN_READ_COMMITTED, 0));
       
       SQLDriverConnect(dbc,...);
        SQLAllocHandle(SQL_HANDLE_STMT, dbc, Stmt);
        
        /* Checking that after connection we have that isolation level */
        CHECK_DBC_RC(dbc, SQLGetConnectAttr(dbc, SQL_ATTR_TXN_ISOLATION, &isolation,
          SQL_IS_POINTER, NULL));
      // Here it's gonna be fine
        is_num(isolation, SQL_TXN_READ_COMMITTED);
       
        OK_SIMPLE_STMT(Stmt, "SELECT @@transaction_isolation");// or @@tx_isolation
       
        SQLFetch(Stmt);
       // Here the value won't be really "READ-COMMITTED"
        IS_STR("READ-COMMITTED", my_fetch_str(Stmt1, buffer, 1), sizeof("READ-COMMITTED"));
      

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            Lawrin Lawrin Novitsky
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.