Page MenuHomeFreeBSD

Fix PDO Bug in PHP 8
ClosedPublic

Authored by tz on May 5 2021, 8:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 4:17 AM
Unknown Object (File)
Sat, Oct 11, 10:20 PM
Unknown Object (File)
Mon, Sep 29, 8:16 PM
Unknown Object (File)
Fri, Sep 19, 11:47 AM
Unknown Object (File)
Wed, Sep 17, 4:35 AM
Unknown Object (File)
Mon, Sep 15, 8:30 PM
Unknown Object (File)
Sep 14 2025, 10:30 PM
Unknown Object (File)
Sep 14 2025, 4:49 PM
Subscribers
None

Details

Summary

There was a serious bug introduced in PHP 8.0.5: https://bugs.php.net/bug.php?id=80892

Except:
The test script below fails because the pgsql driver seems to treat everything as PARAM_STR, despite being explicitly requested to bind the value as PARAM_INT; the "?" placeholder is therefore replaced with the string '4326' instead of the integer 4326.

The problem is, in PostGIS, the ST_Transform() function has different signatures with different behaviours depending on whether the second parameter is an integer or a string.

As far as I can see, because of this issue, there is no way to pass an actual integer to a function without using explicit, PostgreSQL-specific CAST syntax.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tz requested review of this revision.May 5 2021, 8:40 AM
tz created this revision.

Updating diff with patches for php 7.4.

I tested this on a server where I'm experiencing the issue.

Took the freedom to update the patch with a fix for 7.4 too.

As reviewer I approve this.

This revision is now accepted and ready to land.May 5 2021, 10:45 AM