mysql_sessi...ck_get_first(3)
πΈ mysql_session_track_get_first β bestie, let's peek at session tea πΈ
okay so this one lives in the MariaDB Connector/C manual (third section of the manual, 3, iykyk), and it's literally the function that hands you the first lil crumb of session status change info the server sent your way. precious. π
β¨ NAME β¨
mysql_session_track_get_first β retrieves first session status change information
π SYNOPSIS π
#include <mysql.h>
int mysql_session_track_get_first(MYSQL * mysql,
enum enum_session_state_type type,
const char **data,
size_t *length );
π DESCRIPTION π
so mysql_session_track_get_first() pulls up the first session status change information that came in from the server. like, the opening act. the first slide of the carousel. π¦
depending on which type you asked for, that read-only data pointer is gonna be holding different things:
SESSION_TRACK_SCHEMA: the name of the default schema (database). yes queen, your current db, right there.SESSION_TRACK_SYSTEM_VARIABLES: if a session system variable gets changed, the first call gives you the name of the changed system variable, and the second call gives you the new value. both the name and the value are represented as strings, no cap.SESSION_TRACK_STATE_CHANGE: shows whether the session status has changed. the value is changed as the string"1"(changed) or"0"(unchanged). iconic little binary moment.
and if you want the rest of the tea? further data needs to be obtained by calling mysql_session_track_get_next(3). go get the sequel bestie π«Ά
π PARAMETER π
mysqlβ mysql handle, which was previously allocated bymysql_init(3)and connected bymysql_real_connect(3). don't just hand it a random pointer, she's gotta be established. πtypeβ type of information. valid values are:SESSION_TRACK_SYSTEM_VARIABLESSESSION_TRACK_SCHEMASESSION_TRACK_STATE_CHANGESESSION_TRACK_GTIDS(unsupported) π
dataβ pointer to data, which must be declared asconst char *lengthβ pointer to asize_tvariable, which will contain the length ofdata
β RETURNS β
Zero for success, nonzero if no session tracking information is available. that nonzero is not a vibe, it's just an empty inbox fr fr.
π§ HISTORY π§
mysql_session_track_get_first() was added in Connector/C 3.0 and MariaDB Server 10.2. throwback era, but she ate. π
π SEE ALSO π
and that's the whole page babes β this was Version 3.4 of the MariaDB Connector/C docs, so shoutout to that release for keeping the receipts. stay tracking, stay slaying πβ¨π
π¦ 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