Bug #81464 [Nab->ReO]: Regression: pgsql resource types
| From: | weierophinney@php.net | Date: | Tue, 21 Sep 2021 17:18:22 +0000 |
| Subject: | Bug #81464 [Nab->ReO]: Regression: pgsql resource types | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236733@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81464&edit=1
ID: 81464
Updated by: weierophinney@php.net
Reported by: weierophinney@php.net
Summary: Regression: pgsql resource types
-Status: Not a bug
+Status: Re-Opened
Type: Bug
Package: PostgreSQL related
Operating System: Ubuntu 20.04
PHP Version: 8.1.0RC2
Block user comment: N
Private report: N
New Comment:
It may be in UPGRADING, but that doesn't change the fact that a BC break is being introduced in
a MINOR version. The API should be stable for the entirety of a major release, and these sorts of
things should be introduced with 9.0, not 8.1.
I ask the core team to please reconsider these, as well as other related resource -> resource
object changes made in the 8.1 release (finfo, ldap, and pspell, among others). These changes are
(a) difficult to trace, (b) need to be called out better, and (c) should be limited to new major
versions.
As an example, the laminas-db integration tests failed to discover the change... because they were
skipping tests based on whether or not a "pgsql link" resource was present. The end result
is that we thought we'd tested our postgres functionality against 8.1, and were in fact
skipping those same tests, due to the fact that a change in the API masked the issue. We'd not
thought there were any such changes because:
- There was no RFC related to 8.1 that indicated these changes were happening.
- It was a new minor version, so we wouldn't expect an API change.
We've adapted our code to accommodate the change now, but we shouldn't have needed to
until 9.0.
Previous Comments:
------------------------------------------------------------------------
[2021-09-21 16:21:34] girgias@php.net
This is expected, is documented in UPGRADING, and will be documented in the migration guide.
------------------------------------------------------------------------
[2021-09-21 16:18:14] weierophinney@php.net
Description:
------------
In all prior releases of PHP, the Postgres resources were as stated on https://www.php.net/manual/en/resource.php
With the merging of https://github.com/php/php-src/pull/6791, PHP
8.1.0 is changing pgsql resources into resource objects. This breaks existing code that is checking
for the old resource types as currently documented.
As such, this is a BC BREAK in a minor version.
Test script:
---------------
$pgsql = pg_connect($validConnectionString);
echo get_resource_type($pgsql), "\n";
$pgResult = pg_query($pgsql, $someValidSql);
echo get_resource_type($pgResult), "\n";
Expected result:
----------------
pgsql link
pgsql result
Actual result:
--------------
PgSql\Connection
PgSql\Result
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81464&edit=1