Skip to content

Commit d18479b

Browse files
palichoroba
authored andcommitted
Fix bind params for MySQL 8.3.0+ client library
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
1 parent 3e29700 commit d18479b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

dbdimp.c

+8
Original file line numberDiff line numberDiff line change
@@ -4655,7 +4655,11 @@ static my_ulonglong mariadb_st_internal_execute41(
46554655

46564656
if (!reconnected && num_params > 0 && !(*has_been_bound))
46574657
{
4658+
#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80300
4659+
if (mysql_stmt_bind_named_param(stmt, bind, num_params, NULL) == 0)
4660+
#else
46584661
if (mysql_stmt_bind_param(stmt,bind) == 0)
4662+
#endif
46594663
{
46604664
*has_been_bound = TRUE;
46614665
}
@@ -4697,7 +4701,11 @@ static my_ulonglong mariadb_st_internal_execute41(
46974701
*stmt_ptr = stmt;
46984702
if (num_params > 0)
46994703
{
4704+
#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80300
4705+
if (mysql_stmt_bind_named_param(stmt, bind, num_params, NULL) == 0)
4706+
#else
47004707
if (mysql_stmt_bind_param(stmt,bind))
4708+
#endif
47014709
goto error;
47024710
*has_been_bound = TRUE;
47034711
}

0 commit comments

Comments
 (0)