mysql_commit(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_commit β€” MariaDB Connector/C

okay bestie, so this one's from MariaDB Connector/C and it's literally just one tiny function that does one huge thing. it's giving "small but mighty". let's get into it ✨


🌸 NAME

mysql_commit β€” commits the current transaction πŸ’–


πŸŽ€ SYNOPSIS

#include <mysql.h>

my_bool mysql_commit(MYSQL * mysql);

✨ DESCRIPTION

so basically: mysql_commit() commits the current transaction for the database connection you point it at. that's the whole vibe. 🫢

it returns zero on success β€” and nonzero if an error occurred, which is your cue to go "😭 what happened".


🧚 PARAMETERS

  • mysql β€” a connection identifier, iykyk. this is the one you already allocated earlier with mysql_init(3) and then actually connected using mysql_real_connect(3). no connection, no commit, periodt. πŸ’…

⭐ NOTES

Executing mysql_commit() will not affect the behaviour of autocommit. 🚨

this means β€” and bestie listen β€” any update or insert statements following mysql_commit() will be rolled back when the connection gets closed. so like, don't assume you're safe just because you committed. the autocommit vibe check stays exactly the same. 😭


πŸ”₯ SEE ALSO


πŸ‘‘ SIGN-OFF

that's the page, bestie. this one's from Version 3.4 of the MariaDB Connector/C manual β€” go commit something iconic. πŸŒˆπŸ’œ

πŸ“¦ where this page comes from