Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122284 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85849 invoked from network); 5 Feb 2024 13:54:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Feb 2024 13:54:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707141333; bh=qCu/wtpgC8uYLSXYy5SO15fvMsJnvHxFcj4gGxf6Tvk=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=lr3yu+wey4v2eqsIC2pgME5iwQB0T6ZgcO3uKDdQQ4Hrrrf0k5t5MqQrzkb2Se+fC Bh7s/kuF7ITTtYfz8PP4vC/ZUlUWbZ3iEmIQwSiDl37iAfB3LInhbLherMTXc5snCI bWyWYfDw/4cly07N4fvXrk+h5WLbQon9GjBdork/47OUU1BZUGvvKgmWpxgZ5Umr65 R9ihjxAtST6R3n8uB4oFsH/vbU0dUSLVUZNay6EDe9+WGcLZw5bBtA8+PZeiAnkKuv mJ8FH0XAnyU3lqCnfJRfeuefgaW/A7HInPoAUq7yDVCCtTa5HbaSD6m2QK1/1rmqeA oxbCTmP1RjNlA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DA48518005A for ; Mon, 5 Feb 2024 05:55:31 -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=-2.1 required=5.0 tests=BAYES_00,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 ; Mon, 5 Feb 2024 05:55:30 -0800 (PST) Received: from smtpclient.apple (softbank060067217005.bbtec.net [60.67.217.5]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 2BA98401EA; Mon, 5 Feb 2024 22:54:36 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1707141276; bh=qCu/wtpgC8uYLSXYy5SO15fvMsJnvHxFcj4gGxf6Tvk=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=kWx2xQ9kuufWjpiDFndoFLVuFIEFobDuAcRjQH3AqiuoTDroVeNvLgO5HHITkYNLS UTXnxgPukTHYWFQGC/oiAq/X1uNQ1voGGEP1agqco80Z++5e+yGPFRXu2a8X+6SEXX Xd4eVBIFJf9MNCigRDhroFVHdBOvAQ0ICp89v5UY= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Mon, 5 Feb 2024 22:54:23 +0900 Message-ID: <26F6121A-293E-45E7-B8A5-DA1D02742D28@sakiot.com> References: Cc: PHP internals In-Reply-To: To: Kentaro Takeda X-Mailer: iPhone Mail (21C66) Subject: Re: [PHP-DEV] [Proposal] Add `savepoint()` method to PDO From: saki@sakiot.com (Saki Takamachi) Hi Kentaro, Thank you for your important point. > While most databases use `SAVEPOINT [name]`, but: >=20 > https://github.com/laravel/framework/blob/v10.43.0/src/Illuminate/Database= /Query/Grammars/SqlServerGrammar.php#L453-L456 >=20 > ```php > return 'SAVE TRANSACTION '.$name; > ``` >=20 > SQL Server uniquely uses `SAVE TRANSACTION [name]`. There might be > other variations in databases, so full support could be challenging, > which is something to be mindful of. I think this feature will be implemented for each driver, so it probably won= 't be a problem for anything other than pdo_odbc. As you say, I think I need= to think a little more about pdo_odbc. (When I looked into odbc3 again, I realized that what I had written was not a= n API for odbc, sorry. Therefore, it may be difficult to support this featur= e stably with ODBC.) I'll see if there's a better way. >> change the signature of `rollback()` to `rollback(?string $name =3D null)= `. >=20 > This might lead to confusion due to `rollback()` having multiple > functionalities, as `ROLLBACK` and `ROLLBACK TO [name]` target > different rollback operations. >=20 > Just as `beginTransaction()` and `savepoint()` are separate, perhaps > having a separate method for rolling back to a savepoint might > maintain consistency, for example `rollbackToSavepoint(string $name)`. Regarding this, mysqli's `rollback()` is such a specification, so I used tha= t as a reference. However, it may be safer to separate the method itself. `rollbackTo()` might also be good. Regards. Saki=