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)
Thu, Mar 7, 11:43 PM
Unknown Object (File)
Feb 15 2024, 12:46 PM
Unknown Object (File)
Feb 13 2024, 5:17 AM
Unknown Object (File)
Jan 25 2024, 10:50 PM
Unknown Object (File)
Dec 20 2023, 3:20 AM
Unknown Object (File)
Dec 20 2023, 2:05 AM
Unknown Object (File)
Dec 14 2023, 11:14 PM
Unknown Object (File)
Nov 25 2023, 10:00 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