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

Disconnected database handle cannot be used for another new connection

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.0.13
    • 3.0.4, 2.0.17
    • General
    • None
    • Windows 64-bit

    Description

      Looks like SQLDisconnect() handling with MariaDB ODBC driver is not cleaning up the information properly. Either that or SQLDriverConnect() should properly set the new value from the connection string. In my case, call to SQLDriverConnect() after SQLDisconnect() complained about database name of the previous connection!

      Please see the attached standalone program along with the output. If I use MySQL ODBC driver, then I don't see the same issue. Standalone program uses both MariaDB and MySQL ODBC drivers.

      Attachments

        1. ConnectionReuseIssue.cpp
          5 kB
          Rahul Dhuvad
        2. ConnectionReuseIssue.out
          1 kB
          Rahul Dhuvad

        Activity

          The connector would try to set database from previous connection as a default database for new connection. If there was no such database at the server, connecting would fail. That happened because connector copied database name form connection string to the structure field where SQL_ATTR_CURRENT_CATALOG attribute is stored, if it wasn't set.

          Lawrin Lawrin Novitsky added a comment - The connector would try to set database from previous connection as a default database for new connection. If there was no such database at the server, connecting would fail. That happened because connector copied database name form connection string to the structure field where SQL_ATTR_CURRENT_CATALOG attribute is stored, if it wasn't set.

          People

            Lawrin Lawrin Novitsky
            rdhuvad Rahul Dhuvad
            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.