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

On the long run on single connection the connector increases number of open prepared statements

    XMLWordPrintable

Details

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

    Description

      If you run something like
      ODBC_TEST(test_multi_statements)
      {
      long num_inserted, i;
      SQLRETURN rc;

      for (i= 0; i < 100000; ++i)

      { OK_SIMPLE_STMT(Stmt, "DROP TABLE IF EXISTS t1"); OK_SIMPLE_STMT(Stmt, "CREATE TABLE t1 (a int)"); OK_SIMPLE_STMT(Stmt, "INSERT INTO t1 VALUES(1);INSERT INTO t1 VALUES(2)"); SQLRowCount(Stmt, &num_inserted); diag("inserted: %d(run #%d)", num_inserted, i); FAIL_IF(num_inserted != 1, "Expected 1 row inserted"); rc= SQLMoreResults(Stmt); num_inserted= 0; rc= SQLRowCount(Stmt, &num_inserted); FAIL_IF(num_inserted != 1, "Expected 1 row inserted"); rc= SQLMoreResults(Stmt); FAIL_IF(rc != SQL_NO_DATA, "expected no more results"); SQLFreeStmt(Stmt, SQL_CLOSE); }

      return OK;
      }
      Application at some point will make server reach max_prepared_stmt_count, that will cause for sure error of application, and even a crash in some conditions.

      The patch to fix the problem is in the attached odbc16.diff file

      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.