Skip to content
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

ext/pgsql: Use zval_try_get_string() instead of converting zval #15265

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Aug 6, 2024

No description provided.

convert_to_string(parameter);
S->param_values[param->paramno] = Z_STRVAL_P(parameter);
S->param_lengths[param->paramno] = Z_STRLEN_P(parameter);
zend_string *param_value = zval_try_get_string(parameter);
Copy link
Member

@devnexen devnexen Aug 7, 2024

Choose a reason for hiding this comment

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

seemed a good idea, but you need to release it at some point. would need some bookeeping.

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't thought deeply about it yet, as I haven't really figured out how this works, and it seems to delegate to PDO... which might be an issue.

But I discovered we have a try_convert_to_string() function which might be better

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