mysql_thread_end(3)
π mysql_thread_end(3) β MariaDB Connector/C π
okay bestie, gather round, we're talking about mysql_thread_end() from the MariaDB Connector/C fam πΈ
β¨ Name β¨
mysql_thread_end β releases thread specific memory π§Ήβ¨
π¦ Synopsis π¦
#include <mysql.h>
void mysql_thread_end(void );
(yes the space before that closing paren is exactly how it's written, no I will not be fixing it, it's canon π )
π Description π
ok so listen. mysql_thread_end() is the function you gotta call before a client thread ends. like, before it dips, before it logs off, before it goes to sleep forever π
what it does: it releases the thread specific memory that was allocated by a previous mysql_thread_init(3) call. that's the whole job. very demure, very mindful.
returns void. it gives you nothing back, and honestly? iconic behavior π
π Notes π
ok this is the important part, pay attention bestie π
unlike mysql_thread_init(3), mysql_thread_end() will NOT be invoked automatically when the thread ends. like, nobody's gonna do it for you. no autopilot, no safety net, no little angel on your shoulder πβ
so to avoid memory leaks, mysql_thread_end() must be called explicitly. that's a must, not a maybe. fr fr. periodt. π₯
π History π
this function is deprecated since MariaDB Connector/C 3.0.0. she's a legacy queen, we still love her, but the vibes have moved on π
π«Ά See also π«Ά
mysql_thread_init(3)mysql_thread_safe(3)
and that's the whole page, bestie!! Version 3.4 of the MariaDB Connector/C manny, brought to you with so much love and zero memory leaks (as long as you call that function, which you WILL, right? RIGHT? π€π). mwah, go forth and clean up your threads π§βπ
π¦ where this page comes from
- alpine 3.22: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.23: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.24: mariadb-doc 11.8.9-r0 Β· GPL-2.0-only
- arch rolling: mariadb 13.0.2-2 Β· GPL-2.0-only
- arch rolling: mariadb-lts 12.3.3-2 Β· GPL-2.0-only
- centos-stream 10: mariadb-connector-c-doc 3.4.4-2.el10 Β· LGPL-2.1-or-later
- debian trixie: libmariadb-dev 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- fedora 43: mariadb-connector-c-doc 3.4.5-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 43: mariadb-connector-c-doc 3.4.9-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- fedora 44: mariadb-connector-c-doc 3.4.8-3.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 44: mariadb-connector-c-doc 3.4.9-2.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- nixpkgs unstable: mariadb-server 11.8.8
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- ubuntu questing: libmariadb-dev 1:11.8.3-1build1
- ubuntu resolute: libmariadb-dev 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: libmariadb-dev 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libmariadb-dev 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms