Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122278 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46016 invoked from network); 5 Feb 2024 00:32:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Feb 2024 00:32:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707093230; bh=PaGAd6cmPZPHET4Wwudr0Ya4d6Q4GqGOG/jpTJUGhq8=; h=From:Subject:Date:To:From; b=eo17p+9ps6LMMMCag+B1Vc5GsEnQZzl0rXuAgflPCBZsI0R71v+YkDOWBLHRPD229 ncKZyMCqXeCEWzn79wuLytSr9yrT1LzI/BQBrusXNGlNiYqfJfA4kJGG5LDEdym8Ny r3hwLS75kHyJirZTvLbrWvCMUej97LyvwW78B6fGDvND8Ifx2HDTCcAy+Wiyk4+WSy Xi6zMEC1UYxFNSj7y0Or2vHN2fdpHZFTNNBBaX72XNHx+Vgya5V6zvAWXTJhBSDfrj VpebLoiQgt7RvJ0s5QGqm33EduZZwx8d0zztpWPo98uMZgLHkGieYE8YgPigarOzGp 1hrIPRZwuFClA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1838218005F for ; Sun, 4 Feb 2024 16:33:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (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 ; Sun, 4 Feb 2024 16:33:46 -0800 (PST) Received: from smtpclient.apple (softbank060067217005.bbtec.net [60.67.217.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id D0CED4001E for ; Mon, 5 Feb 2024 09:32:51 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1707093171; bh=PaGAd6cmPZPHET4Wwudr0Ya4d6Q4GqGOG/jpTJUGhq8=; h=From:Subject:Date:To:From; b=c3IrDJI7rGL4cgNcS2MpvpBrE0ycfhauQsz0b+fdPq2bt1tnHMk2122tL3V+T/pUh uK8jkelEdwHamemkiP0I/rbey3k3kHxjFEY8Suaz2bMLEcZ3iNVuQ7k0VsGdObNrKI ehZ/dk2bkfdQJ5euJl9IJU9p2WkQc0jnWXudoDgM= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Message-ID: <325E790F-5E88-4559-862F-6C4ACBC89779@sakiot.com> Date: Mon, 5 Feb 2024 09:32:39 +0900 To: PHP internals X-Mailer: Apple Mail (2.3731.700.6) Subject: [Proposal] Add `savepoint()` method to PDO From: saki@sakiot.com (Saki Takamachi) Hi internals, I'm thinking of adding a `savepoint(string $name)` method to PDO. = Similarly, add `releaseSavepoint(string $name)` and change the signature = of `rollback()` to `rollback(?string $name =3D null)`. Savepoint is a feature defined in SQL99, so it is a feature supported by = many databases. Therefore, I thought it would be a good idea to support = this with PDO. If we use `savepoint()` before a transaction has started, it is expected = that a `PDOException` will be thrown. Similarly, if we use = `releaseSavepoint()` or `rollback('savepoint_name=E2=80=99)` when there = is no savepoint, an exception will be thrown. Only pdo_odbc cannot predict what kind of database will be used, but in = the odbc3 API, we can use `supportsSavepoints()` to find out whether the = database supports savepoints. FYI, mysqli already has support for savepoints. I would like to know your opinion. Regard. Saki=