Skip to content

Commit b67c6db

Browse files
committed
Fix calls to mysql_server_end()/mysql_library_end()
- Stop calling `mysql_library_end()` in `dbd_db_destroy()` as this leads to issues with OpenSSL in specific circumstances. - Call `myql_library_end()` instead of `mysql_server_end()` as the latter has been deprecated. - Add missing define for `dbd_discon_all` See also: - https://dev.mysql.com/doc/c-api/8.4/en/mysql-server-end.html - https://dev.mysql.com/doc/c-api/8.4/en/mysql-library-end.html Closes #431
1 parent 9fa5eac commit b67c6db

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dbdimp.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,7 @@ int dbd_discon_all (SV *drh, imp_drh_t *imp_drh) {
18271827
dTHX;
18281828
PERL_UNUSED_ARG(drh);
18291829

1830-
mysql_server_end();
1830+
mysql_library_end();
18311831

18321832
/* The disconnect_all concept is flawed and needs more work */
18331833
if (!PL_dirty && !SvTRUE(perl_get_sv("DBI::PERL_ENDING",0))) {
@@ -1871,7 +1871,6 @@ void dbd_db_destroy(SV* dbh, imp_dbh_t* imp_dbh) {
18711871
}
18721872
dbd_db_disconnect(dbh, imp_dbh);
18731873
}
1874-
mysql_library_end();
18751874
Safefree(imp_dbh->pmysql);
18761875

18771876
/* Tell DBI, that dbh->destroy must no longer be called */

dbdimp.h

+1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ struct imp_sth_st {
237237
#define dbd_db_destroy mysql_db_destroy
238238
#define dbd_db_STORE_attrib mysql_db_STORE_attrib
239239
#define dbd_db_FETCH_attrib mysql_db_FETCH_attrib
240+
#define dbd_discon_all mysql_discon_all
240241
#define dbd_st_prepare mysql_st_prepare
241242
#define dbd_st_execute mysql_st_execute
242243
#define dbd_st_fetch mysql_st_fetch

0 commit comments

Comments
 (0)