Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122286 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93976 invoked from network); 5 Feb 2024 16:30:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Feb 2024 16:30:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707150672; bh=9/M+36wei9ecOsHh949xFkWaKsgGhUx31/1s5U+eLks=; h=In-Reply-To:References:Date:From:To:Subject:From; b=mVueH0kc19CZMKexO3SHU+XciMqImMbcxESRVKhPTCI7l69OujmPLBe+6x9c2cPtN IR61a6WJf+VEUCg5m20wHJyowQX9SHHWK5CApcg62Veh6x1i8WkC1Jz2zrQGlIwG/D QmpobOS56ojL1VBHGVVIL2EUenJfisjIxu0lCTIXDCHmchXPs9MhLxjYvM13Dzn9xE XjCZEV8c8N27ORfe722vB2OlJn/LCFAn1PDSYvCDU3Lb62yasws59tm0c0OvRkg0d2 hftPFZCsf0pEf9iMRcw/E9NQ5dRFPqKz44Xt85SoxpOx4e6r5E4zIlYikicvgyVoCo tfoE9WHcle8tw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A4F38180039 for ; Mon, 5 Feb 2024 08:31:11 -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=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 08:31:11 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 1EB3C3200AC7 for ; Mon, 5 Feb 2024 11:30:17 -0500 (EST) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Mon, 05 Feb 2024 11:30:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1707150616; x= 1707237016; bh=QzZGvJfl+BeSow+qKH1iuywNkV7HTHO28flSHoYdsmQ=; b=K 2pJR/+uyJWShdMEtvXqh7Yhl10V+qAvxxUSWwXUyTvNi1OIgidjCLq7F6XQG/vXe VVd+K+ipySRieFTebnsP5S8TFD+cscvnsmu+Dzeg/+XTWDvwzCGRGEwWKJWRHDsY 5iXZPAUBNp1G+AZQ7LIhEgwtfOrPg/EhHLta6y+qVLIiv/mn5QjpUqYWze4pYrEU t5/3fnOb9qy6FvRKU03bWdayhUoqbn7ahO/1QQqoWuO0G/cVPrBgwzG1unBCTG47 19UD1RqOkWM33WH34dhFLQWM14+7Ygm0O4Mh8WI8nSX8gSfFII3Iiv09ADrDurXB nbEfLv7GltxCYTgtO0nKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1707150616; x=1707237016; bh=QzZGvJfl+BeSow+qKH1iuywNkV7H THO28flSHoYdsmQ=; b=fBH6GA3N6zPJxaf2NmUZ6TV+G0ZtgTmB92wlecukgXJa s7wEAuk4BbudjZuvfvP3H109+oZsnkW3SfSInWqaSUbRxi4P/axPX1U6vy9U64TQ LEV2rrZzOs9DXKv/ZvgEQYeiXHMxd0JPdKyWE7wQVtgAlri76FHi+/9J1y/RIWPg bhh07kdZmfuZ+zNXY3DLp5xFG9p07LcPP+V0nsH55lMjacKXfX/jrNYQBSykippI UH/HYHcvgUNNIk/qmq3qaYr++bVeoyaVILOocr7AhAyOZS4D+P0VDtzW7vV6fAqR nmZMneO584yp5smn9OtZ/CvIUlMhrBsLQWG2MR9Geg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedvtddgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeekteelheffgeefvddufeeujeekhfdvtdeuuedvveet ieevheeludegjeduhffhteenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgr rhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 201B21700093; Mon, 5 Feb 2024 11:30:16 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-144-ge5821d614e-fm-20240125.002-ge5821d61 MIME-Version: 1.0 Message-ID: <1d6e1a6a-7508-40d1-a146-a7b9f67327b4@app.fastmail.com> In-Reply-To: <26F6121A-293E-45E7-B8A5-DA1D02742D28@sakiot.com> References: <26F6121A-293E-45E7-B8A5-DA1D02742D28@sakiot.com> Date: Mon, 05 Feb 2024 16:29:54 +0000 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [Proposal] Add `savepoint()` method to PDO From: larry@garfieldtech.com ("Larry Garfield") On Mon, Feb 5, 2024, at 1:54 PM, Saki Takamachi wrote: > Hi Kentaro, > > Thank you for your important point. > >> While most databases use `SAVEPOINT [name]`, but: >> >> https://github.com/laravel/framework/blob/v10.43.0/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php#L453-L456 >> >> ```php >> return 'SAVE TRANSACTION '.$name; >> ``` >> >> 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 an API for odbc, sorry. Therefore, it may be difficult to support > this feature stably with ODBC.) > > I'll see if there's a better way. > >>> change the signature of `rollback()` to `rollback(?string $name = null)`. >> >> This might lead to confusion due to `rollback()` having multiple >> functionalities, as `ROLLBACK` and `ROLLBACK TO [name]` target >> different rollback operations. >> >> 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 that as a reference. However, it may be safer to separate the > method itself. > > `rollbackTo()` might also be good. I like this proposal. It's a good incremental improvement to PDO. I also agree with rollbackTo(), to avoid confusion. --Larry Garfield