fix(Data/MySQL): replace deprecated mysql_stmt_bind_param() with mysql_stmt_bind_named_param()

This commit is contained in:
Günter Obiltschnig 2024-03-29 08:26:38 +01:00
parent 47c4f073e6
commit fa8dd55c8c
2 changed files with 3 additions and 3 deletions

View File

@ -80,8 +80,8 @@ void StatementExecutor::bindParams(MYSQL_BIND* params, std::size_t count)
if (count == 0) return;
if (mysql_stmt_bind_param(_pHandle, params) != 0)
throw StatementException("mysql_stmt_bind_param() error ", _pHandle, _query);
if (mysql_stmt_bind_named_param(_pHandle, params, count, nullptr) != 0)
throw StatementException("mysql_stmt_bind_named_param() error ", _pHandle, _query);
}

View File

@ -205,7 +205,7 @@ void SQLExecutor::bareboneMySQLTest(const char* host, const char* user, const ch
bind_param[4].buffer = &fifth;
bind_param[4].buffer_type = MYSQL_TYPE_FLOAT;
rc = mysql_stmt_bind_param(hstmt, bind_param);
rc = mysql_stmt_bind_named_param(hstmt, bind_param, 5, nullptr);
assertTrue (rc == 0);
rc = mysql_stmt_execute(hstmt);