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

Bind param values manually since PDOStatement::execute() will assume … #15919

Merged
merged 4 commits into from May 7, 2020

Conversation

diosmosis
Copy link
Member

…params are all strings. This causes null values to not be bound correctly.

I checked and mysqli appears to be fine.

…params are all strings. This causes null values to not be bound correctly.
@diosmosis diosmosis added the Needs Review PRs that need a code review label May 6, 2020
@diosmosis diosmosis added this to the 4.0.0 milestone May 6, 2020
return $this->_stmt->execute($params);
} else {
return $this->_stmt->execute();
foreach (array_values($params) as $index => $paramValue) {
Copy link
Member

Choose a reason for hiding this comment

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

btw does it make sense to add one integration test for this with a null value?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 was planning to but forgot

Copy link
Member

@tsteur tsteur May 6, 2020

Choose a reason for hiding this comment

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

👍 code looks good otherwise and tested it locally, worked. feel free to merge once you've added a test. Must have been a hard find this bug

@diosmosis diosmosis merged commit d829c23 into 4.x-dev May 7, 2020
@diosmosis diosmosis deleted the pdo-null-bind branch May 7, 2020 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants