Re: [RFC][Discussion] Add MariaDB-specific features to mysqlnd and mysqli

From: Date: Thu, 16 Apr 2026 00:23:38 +0000
Subject: Re: [RFC][Discussion] Add MariaDB-specific features to mysqlnd and mysqli
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-130656@lists.php.net to get a copy of this message
On 2026-04-16 01:39, Georg Richter wrote:
If mysqli were to automatically inject START TRANSACTION and COMMIT, it could unexpectedly commit a user's existing work or interfere with their manual transaction logic. Couldn't a SAVEPOINT command be injected instead, with a RELEASE SAVEPOINT on success and ROLLBACK TO SAVEPOINT on error? Of course now the driver has to be aware of any current transaction to know it's to use savepoints instead of a whole transaction...
Furthermore, an 'automatic' transaction would be a false promise on engines like MyISAM, where BEGIN and COMMIT are simply ignored, still resulting in partial inserts. At which point the recommendation to users to wrap bulk executions in such commands is ineffective anyway. But if they're using a nontransactional engine they should already be aware of these pitfalls.


« previous php.internals (#130656) next »