Follow-up GH-21434: Fixed the behavior when using FETCH_DEFAULT#21864
Follow-up GH-21434: Fixed the behavior when using FETCH_DEFAULT#21864SakiTakamachi wants to merge 1 commit intophp:PHP-8.4from
FETCH_DEFAULT#21864Conversation
|
@SakiTakamachi |
…value, it was modified so that the default value is not overridden.
75cf4a9 to
c5a2b40
Compare
|
@iliaal Therefore, setting the initial value here as |
Girgias
left a comment
There was a problem hiding this comment.
Seems fine, but I haven't tried this on 8.5
|
The added tests and the tests that are currently failing in CI passed locally on 8.5. |
For failing tests there is separate PR ( #21863 ) still needed even with this change for 8.5 & master, new test in those branches needs to be adjusted. |
|
Hmm, the results differ from my local environment… It seems I might be missing something. I’ll double-check. |
|
Looked like it was need to me, but maybe I'm wrong, if it fixes things then I'll close the PR |
|
Ah, I resolved the conflict incorrectly when applying the patch to 8.5. I’ve fixed it and am running CI again. |
|
The CI failures on 8.5 and master are caused by adding the The validation expects that when the default value is used, all flags should also come from the default value, and any flags passed as arguments should be ignored. In other words, |
|
I'll close the other PR |
Follow up #21434
The changes in the above PR resolve most of the issue, but validation can still fail when
FETCH_DEFAULTis combined with additional flags.This happens because the default value already stores both the mode and its flags, and the implementation then attempts to combine it further with newly specified flags.
In the validation function, when
FETCH_DEFAULTis specified, any flags provided alongside it are completely ignored, and validation is performed under the assumption that the existing default value will be used as-is.The manual describes
FETCH_DEFAULTas “Special value for using the current default fetch mode.” While it is somewhat unclear whether flags should be included in the default value, the current behavior does include flags as part of the default. Therefore, this change respects the existing implementation.Specifically, when attempting to set
FETCH_DEFAULTas a new default value, the update is skipped to avoid overwriting the current setting.