Skip to content

Commit 2edf89e

Browse files
committed
ext/pdo_pgsql: Delete unused constants
These constants were added by 6ed1819 but they are not used anymore. They are undocumented which is why I've stumbled upon this.
1 parent f39c07a commit 2edf89e

File tree

6 files changed

+5
-59
lines changed

6 files changed

+5
-59
lines changed

NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ PHP NEWS
113113
. Implement GH-15387 Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0) or
114114
Pdo\Pgsql::prepare(…, [ PDO::ATTR_PREFETCH => 0 ]) make fetch() lazy
115115
instead of storing the whole result set in memory (Guillaume Outters)
116+
. Removed unused constants Pdo\Pgsql::TRANSACTION_*.
116117

117118
- PDO_SQLITE:
118119
. throw on null bytes / resolve GH-13952 (divinity76).

UPGRADING

+3
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ PHP 8.5 UPGRADE NOTES
9696
. A ValueError is now thrown when trying to set a cursor name that is too
9797
long on a PDOStatement resulting from the Firebird driver.
9898

99+
- PDO_PGSQL:
100+
. Removed unused constants Pdo\Pgsql::TRANSACTION_*.
101+
99102
- SimpleXML:
100103
- Passing an XPath expression that returns something other than a node set
101104
to SimpleXMLElement::xpath() will now emit a warning and return false,

ext/pdo_pgsql/pdo_pgsql.c

-5
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,6 @@ PHP_METHOD(Pdo_Pgsql, setNoticeCallback)
179179
PHP_MINIT_FUNCTION(pdo_pgsql)
180180
{
181181
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_ATTR_DISABLE_PREPARES", PDO_PGSQL_ATTR_DISABLE_PREPARES);
182-
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_IDLE", (zend_long)PGSQL_TRANSACTION_IDLE);
183-
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_ACTIVE", (zend_long)PGSQL_TRANSACTION_ACTIVE);
184-
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_INTRANS", (zend_long)PGSQL_TRANSACTION_INTRANS);
185-
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_INERROR", (zend_long)PGSQL_TRANSACTION_INERROR);
186-
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_UNKNOWN", (zend_long)PGSQL_TRANSACTION_UNKNOWN);
187182

188183
PdoPgsql_ce = register_class_Pdo_Pgsql(pdo_dbh_ce);
189184
PdoPgsql_ce->create_object = pdo_dbh_new;

ext/pdo_pgsql/pdo_pgsql.stub.php

-15
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,6 @@ class Pgsql extends \PDO
1818
public const int ATTR_RESULT_MEMORY_SIZE = UNKNOWN;
1919
#endif
2020

21-
/** @cvalue PGSQL_TRANSACTION_IDLE */
22-
public const int TRANSACTION_IDLE = UNKNOWN;
23-
24-
/** @cvalue PGSQL_TRANSACTION_ACTIVE */
25-
public const int TRANSACTION_ACTIVE = UNKNOWN;
26-
27-
/** @cvalue PGSQL_TRANSACTION_INTRANS */
28-
public const int TRANSACTION_INTRANS = UNKNOWN;
29-
30-
/** @cvalue PGSQL_TRANSACTION_INERROR */
31-
public const int TRANSACTION_INERROR = UNKNOWN;
32-
33-
/** @cvalue PGSQL_TRANSACTION_UNKNOWN */
34-
public const int TRANSACTION_UNKNOWN = UNKNOWN;
35-
3621
public function escapeIdentifier(string $input): string {}
3722

3823
public function copyFromArray(string $tableName, array $rows, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {}

ext/pdo_pgsql/pdo_pgsql_arginfo.h

+1-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/pdo_pgsql/php_pdo_pgsql_int.h

-8
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ struct pdo_pgsql_lob_self {
104104
Oid oid;
105105
};
106106

107-
enum pdo_pgsql_specific_constants {
108-
PGSQL_TRANSACTION_IDLE = PQTRANS_IDLE,
109-
PGSQL_TRANSACTION_ACTIVE = PQTRANS_ACTIVE,
110-
PGSQL_TRANSACTION_INTRANS = PQTRANS_INTRANS,
111-
PGSQL_TRANSACTION_INERROR = PQTRANS_INERROR,
112-
PGSQL_TRANSACTION_UNKNOWN = PQTRANS_UNKNOWN
113-
};
114-
115107
php_stream *pdo_pgsql_create_lob_stream(zend_object *pdh, int lfd, Oid oid);
116108
extern const php_stream_ops pdo_pgsql_lob_stream_ops;
117109

0 commit comments

Comments
 (0)