Bug #113055 mysql_stmt_bind_named_param() is missing in 8.2.0
Submitted: 12 Nov 2023 20:26 Modified: 13 Nov 2023 11:11
Reporter: Peter VARGA Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: C API (client library) Severity:S1 (Critical)
Version:8.2.0 OS:SUSE
Assigned to: CPU Architecture:x86

[12 Nov 2023 20:26] Peter VARGA
/usr/lib64/mysql/libmysqlclient.so doesn't have mysql_stmt_bind_named_param() function even the documentation references to it:
1) https://dev.mysql.com/doc/c-api/8.2/en/c-api-introduction.html
2) https://dev.mysql.com/doc/c-api/8.2/en/mysql-stmt-bind-named-param.html

When I build libmysqlclient.so from the source then it only exists locally:
nm -D libmysqlclient.so | grep bind
000000000002eee0 t _Z30mysql_stmt_extension_bind_freeP14MYSQL_STMT_EXT
                 U bind@GLIBC_2.2.5
0000000000047520 t fix_param_bind
000000000002f620 T mysql_bind_param
0000000000039a20 t mysql_extension_bind_free
000000000002f800 t mysql_stmt_bind_named_param
000000000002fa90 T mysql_stmt_bind_param
000000000002fbe0 T mysql_stmt_bind_result

This is the result for the package-library:
nm -D /usr/lib64/mysql/libmysqlclient.so | grep bind
                 U bind
0000000000032100 T mysql_bind_param
0000000000032580 T mysql_stmt_bind_param
00000000000326d0 T mysql_stmt_bind_result

See the lower case "t" before mysql_stmt_bind_named_param. gcc reports the following error and linking fails:
MySQL.cpp:(.text+0x1ac1): undefined reference to `mysql_stmt_bind_named_param'

Any idea how to fix it with the current version 8.2.0? 

How to repeat:
Just link it adding `mysql_config --libs`
[13 Nov 2023 6:10] MySQL Verification Team
Hello Peter VARGA,

Thank you for the report and feedback.
IMHO this is duplicate of Bug #112893, please see Bug #112893

[13 Nov 2023 11:11] Peter VARGA
Yep, it is. I could fix it with editing the libmysql/CMakeLists.txt.

I guess the next update will have a correct libmysql/CMakeLists.txt