Skip to content

Fix GH-15893: Pdo\Pgsql backport fixes from GH-16124 #16158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Oct 1, 2024

No description provided.

@nielsdos
Copy link
Member

nielsdos commented Oct 1, 2024

Hm you updated arginfo but I don't see stub changes?

@devnexen
Copy link
Member Author

devnexen commented Oct 1, 2024

that was a mistake..

if (iter == NULL || EG(exception)) {
RETURN_THROWS();
}

if (iter->funcs->rewind) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think rewind can throw too, but the exception isn't checked in this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I forgot about that detail.

Maybe would be nice to have some FOREACH_ITERABLE macros 🤔

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to change ZPP to fast ZPP so that you can use Z_PARAM_ITERABLE here. As the type error message is not consistent with other TypeError messages atm.

@devnexen devnexen force-pushed the pdo_pgsql_iterable_fix branch from 2bc53b4 to fd7cb52 Compare October 2, 2024 11:21
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the comment from Niels, LGTM

if (iter == NULL || EG(exception)) {
RETURN_THROWS();
}

if (iter->funcs->rewind) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I forgot about that detail.

Maybe would be nice to have some FOREACH_ITERABLE macros 🤔

Z_PARAM_ITERABLE(pg_rows)
Z_PARAM_OPTIONAL
Z_PARAM_STRING(pg_delim, pg_delim_len)
Z_PARAM_STRING_OR_NULL(pg_null_as, pg_null_as_len)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the old zpp this argument was not nullable, it was the last one. The fact this is not caught in CI also means that this case is not tested...

@devnexen devnexen force-pushed the pdo_pgsql_iterable_fix branch from a275127 to d2a9918 Compare October 3, 2024 17:21
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Windows failure is unrelated (I already pinged Arnaud)

@devnexen devnexen merged commit dbcc77d into php:master Oct 3, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants