Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-218

2nd mariadb_stmt_execute_direct with parameters causes crashes appliction

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      10.2 server, C/C master

      Description

      static int conc_new_issue(MYSQL *mysql)

      { MYSQL_STMT *stmt= mysql_stmt_init(mysql); MYSQL_BIND bind[2]; bind[0].buffer_type = MYSQL_TYPE_LONG; bind[0].buffer = (void *)&id; bind[0].buffer_length = 4; bind[0].is_null = &is_null[0]; bind[0].length = NULL;// &length[0]; bind[0].error = &error[0]; mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, &param_count); check_stmt_rc(mysql_stmt_bind_param(stmt, bind), stmt); check_stmt_rc(mariadb_stmt_execute_direct(stmt, "SELECT ?", -1), stmt); check_stmt_rc(mysql_stmt_store_result(stmt), stmt); check_stmt_rc(mysql_stmt_free_result(stmt), stmt); //mysql_stmt_close(stmt); //stmt= mysql_stmt_init(mysql); param_count= 1; mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, &param_count); check_stmt_rc(mysql_stmt_bind_param(stmt, bind), stmt); check_stmt_rc(mariadb_stmt_execute_direct(stmt, "SELECT ?", -1), stmt); mysql_stmt_close(stmt); return OK; }

      Yes, if close stmt between 2 calls, everything will work fine.

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            Lawrin Lawrin Novitsky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: