Skip to content

Commit

Permalink
Fix bind params for MySQL 8.3.0+ client library
Browse files Browse the repository at this point in the history
MySQL 8.3.0 client library started to deprecate mysql_stmt_bind_param()
function. Replacement is a new mysql_stmt_bind_named_param() function.

See: https://dev.mysql.com/doc/relnotes/mysql/8.3/en/news-8-3-0.html#mysqld-8-3-0-deprecation-removal
  • Loading branch information
pali authored and choroba committed Dec 10, 2024
1 parent 3e29700 commit d18479b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dbdimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4655,7 +4655,11 @@ static my_ulonglong mariadb_st_internal_execute41(

if (!reconnected && num_params > 0 && !(*has_been_bound))
{
#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80300
if (mysql_stmt_bind_named_param(stmt, bind, num_params, NULL) == 0)
#else
if (mysql_stmt_bind_param(stmt,bind) == 0)
#endif
{
*has_been_bound = TRUE;
}
Expand Down Expand Up @@ -4697,7 +4701,11 @@ static my_ulonglong mariadb_st_internal_execute41(
*stmt_ptr = stmt;
if (num_params > 0)
{
#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80300
if (mysql_stmt_bind_named_param(stmt, bind, num_params, NULL) == 0)
#else
if (mysql_stmt_bind_param(stmt,bind))
#endif
goto error;
*has_been_bound = TRUE;
}
Expand Down

0 comments on commit d18479b

Please sign in to comment.