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

Crash in SQLExecDirect on UPDATE statement on paramset

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 3.2.5
    • 3.2.6
    • General
    • None
    • Windows

    Description

      Works in the 3.1 release. We do for example:

      update TADef set Range0=?,Range100=?,Format=?,userA_INTERVALL=?,userA_ART=? where keyTA=?

      We bind all parameters and execute -> crash:

      maodbc.dll!std::_String_val<std::_Simple_types<char>>::_Large_string_engaged() Line 2301
      maodbc.dll!std::_String_val<std::_Simple_types<char>>::_Myptr() Line 2293
      maodbc.dll!std::string::append(const std::string & _Right) Line 3395
      maodbc.dll!mariadb::assembleBatchRewriteQuery(std::string & pos, const mariadb::ClientPrepareResult * clientPrepareResult, st_mysql_bind * parameters, unsigned int arraySize, unsigned __int64 currentIndex, bool noBackslashEscapes) Line 741
      maodbc.dll!mariadb::ClientPrepareResult::assembleBatchQuery(std::string & sql, st_mysql_bind * parameters, unsigned int arraySize, unsigned __int64 nextIndex) Line 817
      maodbc.dll!mariadb::ClientSidePreparedStatement::executeBatchInternal(unsigned int size) Line 205
      maodbc.dll!mariadb::PreparedStatement::executeBatch() Line 169
      maodbc.dll!MADB_Stmt::DoExecuteBatch() Line 924
      maodbc.dll!MADB_ExecuteBulk(MADB_Stmt * Stmt, unsigned int ParamOffset) Line 548
      maodbc.dll!MADB_StmtExecute(MADB_Stmt * Stmt, bool ExecDirect) Line 1098
      maodbc.dll!MA_SQLExecDirectW(void * StatementHandle, wchar_t * StatementText, long TextLength) Line 1063
      odbc32.dll!SQLExecDirectCover() Unknown
      odbc32.dll!SQLExecDirect() Unknown
      ...

      When taking a look at assembleBatchRewriteQuery(), we see:

      std::size_t assembleBatchRewriteQuery(SQLString& pos, const ClientPrepareResult* clientPrepareResult,
      MYSQL_BIND* parameters, uint32_t arraySize, std::size_t currentIndex, bool noBackslashEscapes)
      {
      std::size_t index= currentIndex, capacity= pos.capacity(), estimatedLength;
      const std::vector<SQLString> queryParts;// = clientPrepareResult->getQueryParts();
      const std::size_t paramCount= clientPrepareResult->getParamCount();
      const SQLString& firstPart= queryParts[1]; // <========== queryParts is empty
      const SQLString& secondPart= queryParts.front(); // <========== queryParts is empty

      pos.append(firstPart); // <========== CRASH HERE, because queryParts is empty
      pos.append(secondPart);

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            christoph.macheiner@andritz.com Christoph Macheiner
            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.