mysql_thread_id(3)

πŸ“¦
version 13.0.2 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

mysql_thread_id β€” bestie, this one hands you the id of the connection you're on right now πŸͺͺπŸ’–


🌈 SYNOPSIS 🌈

#include <mysql.h>

unsigned long mysql_thread_id(MYSQL * mysql);

πŸ’… DESCRIPTION πŸ’…

okay so picture this: every connection out there has its own little thread id, like a name tag at a party πŸŽ€. The mysql_thread_id() function returns the thread id for the current connection. That's it. That's the whole job. And it does it flawlessly, no cap πŸ‘‘


πŸ¦‹ PARAMETER πŸ¦‹

  • mysql β€” a mysql handle, which was previously allocated by mysql_init(3) and connected by mysql_real_connect(3). Like, it has to be a real, live, already-connected handle, not a random pointer you found in your bag πŸ™ˆ

πŸ“ NOTES πŸ“

  • The current connection can be killed with mysql_kill(3) πŸ”₯ (yes bestie, you can just end it like that).
  • If the reconnect option is enabled, the thread id might change if the client reconnects to the server. So don't go memorising it like it's your forever phone number πŸ’€

⭐ RETURN VALUE ⭐

Returns the thread id of the current connection. That's the vibe. That's the whole return value 🫢


🌸 SEE ALSO 🌸


πŸ’– that's the whole page, you ate it πŸ’– This was MariaDB Connector/C, version 3.4, and yeah β€” it's literally called mysql_thread_id(3). Go forth and get that thread id, icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from