mysql_send_query(3)
β¨ NAME β¨
mysql_send_query β bestie, this one fires off a SQL statement and then dips before the server even answers π no waiting around, no resultset, just vibes and a promise
(it's a page from the MariaDB Connector/C manual, if you were wondering who wrote this banger)
πΈ SYNOPSIS πΈ
#include <mysql.h>
int mysql_send_query(MYSQL * mysql,
const char *query,
unsigned long length);
π DESCRIPTION π
Okay so here's the tea: mysql_send_query sends a statement to the server and then literally does not wait for the Server OK packet and/or the resultset to come back. She said "sent π" and moved on with her life. That's the whole personality.
π PARAMETERS π
mysqlβ a mysql handle π«Ά the one you already got frommysql_init(3)and then connected withmysql_real_connect(3). Can't skip those steps, she needs a real connection to talk to.queryβ the SQL statement itself. The whole reason we're here β¨lengthβ how long that SQL statement is. Yes, you have to tell her. She's not counting for you.
π¦ NOTES π¦
- The OK packet and the result set package? Those don't just appear, bestie β you have to go get them yourself using the
mysql_read_query_result(3)function. She sends, you retrieve. Teamwork π«Ά mysql_send_query()can be used for semi asynchronous operation. And like, yes, the function itself is blocking π, but an event driven application can go do other tasks in the meantime until the result set is available. Multitasking queen behavior π
π EXAMPLE π
Wanna see how mysql_send_query() plays out in an event driven model? Then go read Jan Kneschke's article, βAsync MySQL Queries with C-APIβ. It's the blueprint, fr fr πβ¨
π SEE ALSO π
mysql_real_querymysql_read_query_result
Version 3.4 β yeah that's the one, that's the version π and with that, this little mysql_send_query(3) page is a wrap. Stay async, stay iconic, and go read your result sets, bestie ππ¦β¨
π¦ 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