Skip to content

ext/pgsql: Stop using useless convert_to_boolean() API #18683

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 1 commit into from
May 29, 2025

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented May 28, 2025

There are better ways of handling this than casting the zval in place

break;
case PHP_PG_ASYNC_REQUEST_CANCEL: {
PGcancel *c;
char err[256];
int rc;

c = PQgetCancel(pgsql);
RETVAL_LONG((rc = PQcancel(c, err, sizeof(err))));
rc = PQcancel(c, err, sizeof(err);
Copy link
Member

Choose a reason for hiding this comment

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

once you fixed this little typo, I ll have a better look ; seems ok at first glance.

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems like we should not be using PQCancel any longer? https://www.postgresql.org/docs/current/libpq-cancel.html#LIBPQ-PQCANCEL

Also it can only ever return 0 or 1, so the rc < 0 check is... wrong

There are better ways of handling this than casting the zval in place
@Girgias Girgias force-pushed the pgsql-convert-bool branch from 872e404 to e3ea426 Compare May 29, 2025 15:09
@Girgias Girgias merged commit 0cdd3c3 into php:master May 29, 2025
9 checks passed
@Girgias Girgias deleted the pgsql-convert-bool branch May 29, 2025 18:09
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.

2 participants