mysql_stmt_warning_count(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

πŸ’– mysql_stmt_warning_count β€” a MariaDB Connector/C moment πŸ’–

okay bestie, settle in, because this one is short but she matters. This is mysql_stmt_warning_count(3), part of the MariaDB Connector/C lineup, and she does exactly one job and does it flawlessly. no notes. 🫢


✨ NAME ✨

mysql_stmt_warning_count β€” returns the number of warnings from the last executed statement. that's it, that's the whole girl. πŸ’…


🌸 SYNOPSIS 🌸

#include <mysql.h>

unsigned int mysql_stmt_warning_count(MYSQL_STMT * stmt);

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, you call this and she hands you back the number of warnings that came out of the last executed statement. and if there were no warnings? she's giving you a big fat zero, no drama, no attitude. πŸ’–

πŸŽ€ Parameter

  • stmt β€” a statement handle, which was previously allocated by mysql_stmt_init(3). like, you gotta have made her first, bestie. she's not gonna spawn out of thin air. ✨

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns the number of warnings. that's it. a whole unsigned int of truth. πŸ”₯


🌈 NOTES 🌈

  • if you actually wanna read the warning messages (not just count them), you should use the SQL command SHOW WARNINGS. the count is the vibe check, SHOW WARNINGS is the group chat receipts. πŸ’¬
  • if SQL_MODE TRADITIONAL is enabled, an error instead of a warning will be returned. so like... plot twist. for detailed information check the server documentation. πŸ‘€
bestie this is important: with SQL_MODE TRADITIONAL on, you're not getting a cute little warning count situation β€” you're getting an error. know the difference, protect your peace. 😭

πŸ“œ History

This function was added in Connector/C 3.0. she's been iconic since day one, fr fr. ⭐


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie! πŸ’– Version 3.4 of MariaDB Connector/C, brought to you with love β€” mwah, go forth and count your warnings responsibly. πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from