Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130659 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id E47581A00BC for ; Thu, 16 Apr 2026 07:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1776325781; bh=avmeJAviAQ4dL0z0ig776fj2u8p0KMR7CUPjcjsfaCE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kf3KCfz8hUx3dis6Q395JIG18FC7v09n10fSibHrElI4e/oPplcL8+c5VvTIt5JkF CPfCOoAeV6KPdc40gvFdNPHzwlxkVDZ7L3peIvKzOMf2OfFxaEx/DPM99JwAFzB7YD BEhBiFu386n6vgvFqCOa9vvdkZxQ7r5ayBMYiVft5/a1oKLDKvEtBlztYFLd0og7fG rHDp5BWdkuzFhdj7xCAs4k+J8mqYwRf/jvsHyKsS861tXQNXNxgoMHkbsqC+wk0k9W CvgsLFsJMRw1sS44EcgbjeckdXj97mlRbJcWI0qFoaeeVwOo24KmFhc76AjrwE0g7t y2ZGJ/QqwTgkg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A834C180050 for ; Thu, 16 Apr 2026 07:49:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 16 Apr 2026 07:49:39 +0000 (UTC) Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-43cf8d550bdso6995660f8f.0 for ; Thu, 16 Apr 2026 00:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776325773; cv=none; d=google.com; s=arc-20240605; b=CxzMb9ZG+jLOtOSoSBJCfpyqSpgy+wTNL0e9NnWQyWAGb62qORpDxHfZmAXlzWYVbp R2xHXKvxVQ/nhkhs9bkNky8RRQQxiz7zVF2hHlz4nIxaaxb/5kuIiCSX/PgXF6KPEl1e F5kT+fy45WWkoBpXkzHrGEnEADXTLU3XT4jfXo2uqHlT0mXefb3HPcdIc88l9tsk4hpq fG/b/wUC0R8FN0nzHHTMdhw1VSsv9Laptl/O673CA1cLx/lBab53aILDIvoXh1fJ5rge RqoM/LpLAD+qu7s0QLKFM8zw1C0dUw97vaYb9WtBiuO63nAsB+pfa9GSTj6vEHOJpcq+ CJ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=sd57Nw3/Yx+GW9BFgMzkovdCm0kdEGo/kq9OIY0iYCs=; fh=rSlQ1Emc5WKEeHpXd1gzq8oHm6DzBBxBAUu2CXQE5I4=; b=WI9fD04Yd+1D01zOF12CgGWUfybpohNM0Vmh76/gU3dxExpCAnrSOvVWNIeGAcJAaQ GKNDOD6KFcQiqGjeSAonEcTTvwKiy3v97C+C2UIfH47Z4pgNGTuL2wHAg/0e0f/JYB6p cAXpCHOOj4Egh9+nnCWB1gw5oQ8J4yYG0aSI+CVzlQbQJkRp3Est4cPL8LQEqHpTxl2s 7KO9TmlCgTpa0cnaj/t4RDh87ei2h+Vb6Oz3pg/gzhedkRl2HlfIxTNZjt0Z6ciJ//ce yQ84IlYISoZ0iTAUudT457CkTOAvsQzwiG7Zo5IMi2ycgOCVkWsWx8Yw33nIyFYf82RY mKNg==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mariadb.com; s=google; t=1776325773; x=1776930573; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sd57Nw3/Yx+GW9BFgMzkovdCm0kdEGo/kq9OIY0iYCs=; b=ZqXu07zFdfGszhHeMnigST7dfy6mxytrdjpLKwDb1DohRrl2eq17St6Fa1dUnFjgVA SMUD9GmwFcjYjGrdLLTSZUh+EBz3e0XaGy9HxBJoMNmRDtkqFkyRo+p2gRp0VXQaDI3T Xwjpwjp8r+S1AAbQOC2172E3CsOoLdTvoHgiE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776325773; x=1776930573; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sd57Nw3/Yx+GW9BFgMzkovdCm0kdEGo/kq9OIY0iYCs=; b=gP04QssfqtsEm9YTvrU8CGtyW2suagPfQ7ZlVbho4+u23vDs0YWL4F2j4ODW4oo6MI PewCaY5nnK15f689Go6mViXmIKt6EYVT5awoWBYR/6VR9Q4ROktTCCJfHjOY+QX/3wJ2 PX9gu17UjAh6NVEnp3eGJs5CURvgm8Jo5X0SydxqLPRtulfg6mNHQTfizFSdzt6ucu0S fOmYvkMM5B2qPEpfMfaAIFYFcpNsMDmtE8TVpqQDk3XYvncYSbkJVsTMRud4lrv+5zD+ 8EpROsQFpCxxHf18G/4A6M20GC3p9S/Y7S4Pnl6GVU8It/6USiCFeg+OuPG6sP6VZUys CayA== X-Gm-Message-State: AOJu0Yy3t+6bBX2OB90zUvRXPK2vJVbFRNdMtIFslQ5pBamL6RBaJZ96 bUxStoWnqkqljWo3T+qriN1mcK+nlDhRrRaBvKcfiSKe05OHZFwgRU6BDTp/0Ok8UYFX/AfeE4X nhq8xqNO3NDqBjzS4hPXiozwtP1yx6cT5a+f2Wkm0WQ== X-Gm-Gg: AeBDiesEuYQn4WY4qEmdpc1sZPK3TobbZrsrl+YGpHv9O/qLZ20RbucpN69JKXyAjoV zFCrfo/kmhmqfbMXMAXVr/9B0tt90F4Bp0JK9I09aZlMnfVlkkIG3jJS6KhzGHqQQdXbL/uZSXg SCNQSswEV7Q2LZblepBdfTL2fVhMu1MqGlA/8wGDfYQKJWb/FSSwB+HVhsO9b7IAz7jpwCbGD+7 Et4GQhtjaPjfyOL8F4y3h+fdYgtn15vQI4viXumRnKxuZnf5cv3qMEYOOq8JX1F71790YXKPXVy alAZgZJHc510yNQMBoE= X-Received: by 2002:a05:6000:2dc1:b0:43d:7af0:3a83 with SMTP id ffacd0b85a97d-43d7af03e3emr21487538f8f.41.1776325772454; Thu, 16 Apr 2026 00:49:32 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <9c129841-9ec5-48e5-b6a1-b2589acdd04d@varteg.nz> In-Reply-To: <9c129841-9ec5-48e5-b6a1-b2589acdd04d@varteg.nz> Date: Thu, 16 Apr 2026 09:49:21 +0200 X-Gm-Features: AQROBzBtH0OLG8DKGdq0kmOx6Q1t3JAWIBL8AZf6R7Xbmyegi17dz1dbKgUCc44 Message-ID: Subject: Re: [PHP-DEV] [RFC][Discussion] Add MariaDB-specific features to mysqlnd and mysqli To: Weedpacket@varteg.nz Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000ac4a47064f8f12ae" From: georg@mariadb.com (Georg Richter) --000000000000ac4a47064f8f12ae Content-Type: text/plain; charset="UTF-8" Hi, > 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... > Transaction safety should always be guaranteed in the application code, not in the driver. The driver cannot know how transactions are handled by the user, whether the underlying tables even support transactions, or what the specific application logic requires. Adding transaction logic into the driver leads to unpredictable state management. For example, if the driver were to automatically issue a RELEASE SAVEPOINT, the application would lose the ability to roll back the execute_many operation as part of its own broader error-handling logic. > > 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. > Exactly! /Georg -- Georg Richter, Staff Software Engineer Client Connectivity MariaDB Corporation Ab --000000000000ac4a47064f8f12ae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,


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 <= br> use savepoints instead of a whole transaction...

<= /div>
Transaction safety should always be guaranteed in the applic= ation=20 code, not in the driver. The driver cannot know how transactions are=20 handled by the user, whether the underlying tables even support=20 transactions, or what the specific application logic requires.

Addin= g transaction logic into the driver leads to unpredictable state=20 management. For example, if the driver were to automatically issue a=20 RELEASE SAVEPOINT, the application would lose the ability to roll back=20 the execute_many operation as part of its own broader error-handling=20 logic.=C2=A0


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.
=

Exactly!

/Georg= =C2=A0


--
Georg Richter, Staff Software Engi= neer
Client Connectivity
MariaDB Corporation Ab
=
--000000000000ac4a47064f8f12ae--