Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
database system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2023 at 08:47 UTC
Updated:
24 Oct 2023 at 09:59 UTC
Jump to comment: Most recent
Comments
Comment #2
mondrakeComment #3
catchComment #5
mondrakeComment #6
mondrakeComment #7
mondrakeWe’d need
voidClientTransaction()to be public in #3384999: Introduce a Schema::executeDdlStatement method, better make it so now so we can also add it to the interface.Comment #8
mondrakeComment #9
daffie commentedLooks good. A couple of remarks on the MR.
Comment #10
mondrakeThanks for review @daffie, addressed all your points.
Comment #11
daffie commentedComment #12
mondrake@daffie if we add
@internal, then I think we should remove the method from the interface.Funnily, I tried to find guidance on use of
@internalin Drupal, but I could not find any in the coding standards.To me,
@internalmeans 'hey developer do not use this method in your code, it may change without notice'. But in this case, we will be actually recommending to use this method to database driver developers when they need to void the transaction stack. So I'm not sure adding@internalis actually the right thing to do.Comment #13
mondrakeBTW, we already have the same issue with ::unpile() and ::rollback(), and we did this in the docblock:
if we just add
also to the new method will it be enough?
Comment #14
mondrakeDone #13 in the last commit to the MR.
Comment #15
daffie commentedNot adding the new method to the interface is for me the right decision.
All code changes look good to me.
For me it is RTBC.
I am changing the priority to critical, as without this change the result can be data loss.
Comment #16
catchIn #15 @daffie writes that not adding the method to the interface is the right change, but the MR does in fact add the new method to the interface.
I think the documentation addition with the note is probably fine, we have a general problem of 'interfaces, but only supposed to be called by a tiny subset of code' which it is not for this issue to resolve. However, it would be good to confirm whether this was a mis-type on the comment or a mistaken RTBC, so moving back to needs review.
Comment #17
mondrakeAh sorry, I commented in Slack but did not copy here:
@catch the
is a nice one, and one that one may argue is a language limitation of PHP. I was thinking about an assert on the backtrace and looking for the namespace of the caller... but yes, it's not for here.
Comment #18
daffie commentedI can live with the new method being on the interface.
Back to RTBC.
Comment #19
catchI think our only other option would be just having a public method on the class and calling it, which might be valid, but it's a bit of an existential issue for Drupal core to sort out more widely, and this is a critical bugfix.
Committed/pushed to 11.x, thanks!
Comment #21
catch