ARTICLE AD BOX
I'm working on PHP code and using prepared statements where possible, with the PDO prepare emulation turned off. I'm reusing persistent connections to lower overhead, which also means the query plan cache gets reused across requests so long as the connection gets reused.
But I was wondering about explicitly setting the name for the prepared statement, as per the MariaDB docs (and its MySQL docs sibling). It tracks that PDO would internally be executing the query PREPARE stmt_name FROM preparable_stmt and I would want to know if there's any way to manually set stmt_name from the PHP side of things. Or, alternatively, some way to get the assigned name through either the PDO or PDOStatement objects.
I've already looked at PDOStatement::getAttribute but that only has a FireBird and ODBC-specific cursor name attribute available. I've also looked into debug dumps in several ways, but can't seem to find the actual registered statement name.
Currently running on PHP 8.3 / MariaDB 10.11
