Fix bug #80892 PDO::PARAM_INT on pdo_pgsql #6801
Conversation
|
Merged in 340a067 |
|
Hey all - we got a PR related to this change on Laravel: laravel/framework#37168 In summary, previously if you had a That's OK I guess, although fairly unexpected and large breaking change on a patch release? In addition, if we try to adjust Laravel to bind all booleans using But, it does put us in a pretty tough spot, since if we don't merge this PR change, people can no longer perform simple boolean queries in Laravel using PHP 8.0.5, while if we do merge it, we break all applications querying Ultimately, if this PR stands, we would just need to remove this convenience boolean to integer casting when working with Postgres and people could no longer pass booleans in our query builders when querying if a Any thoughts? /cc @driesvints |
| if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) { | ||
| if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT) { | ||
| /* we need to check if the number requires bigints */ | ||
| long long val = strtoll(Z_STRVAL_P(parameter), NULL, 10); |
nikic
Apr 28, 2021
Member
Without having looked into Taylor's issue yet, this code is clearly broken :( If the original value was null or bool, then it will stay as such, while this code assumes the value is always a string. Passing a null to a PARAM_INT binding causes a segfault now (bool doesn't for some reason).
Without having looked into Taylor's issue yet, this code is clearly broken :( If the original value was null or bool, then it will stay as such, while this code assumes the value is always a string. Passing a null to a PARAM_INT binding causes a segfault now (bool doesn't for some reason).
mbeccati
Apr 28, 2021
Author
Contributor
Indeed I thought I had better coverage :(
Indeed I thought I had better coverage :(
|
Thanks @taylorotwell - I will have a better look tomorrow. Also cc-ing @derickr @carusogabriel as RMs |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Created PR for review - I will commit to the appropriate branches when ready.