Skip to content

Commit 85ee575

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 ee6ed3c commit 85ee575

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

dbdimp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4657,7 +4657,11 @@ static my_ulonglong mariadb_st_internal_execute41(
46574657

46584658
if (!reconnected && num_params > 0 && !(*has_been_bound))
46594659
{
4660+
#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80300
4661+
if (mysql_stmt_bind_named_param(stmt, bind, num_params, NULL) == 0)
4662+
#else
46604663
if (mysql_stmt_bind_param(stmt,bind) == 0)
4664+
#endif
46614665
{
46624666
*has_been_bound = TRUE;
46634667
}
@@ -4699,7 +4703,11 @@ static my_ulonglong mariadb_st_internal_execute41(
46994703
*stmt_ptr = stmt;
47004704
if (num_params > 0)
47014705
{
4706+
#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80300
4707+
if (mysql_stmt_bind_named_param(stmt, bind, num_params, NULL) == 0)
4708+
#else
47024709
if (mysql_stmt_bind_param(stmt,bind))
4710+
#endif
47034711
goto error;
47044712
*has_been_bound = TRUE;
47054713
}

0 commit comments

Comments
 (0)