Skip to content

ext/pdo_pgsql: Delete unused constants #18358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ PHP NEWS
. Implement GH-15387 Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0) or
Pdo\Pgsql::prepare(…, [ PDO::ATTR_PREFETCH => 0 ]) make fetch() lazy
instead of storing the whole result set in memory (Guillaume Outters)
. Removed unused constants Pdo\Pgsql::TRANSACTION_*.

- PDO_SQLITE:
. throw on null bytes / resolve GH-13952 (divinity76).
Expand Down
3 changes: 3 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ PHP 8.5 UPGRADE NOTES
. A ValueError is now thrown when trying to set a cursor name that is too
long on a PDOStatement resulting from the Firebird driver.

- PDO_PGSQL:
. Removed unused constants Pdo\Pgsql::TRANSACTION_*.

- SimpleXML:
- Passing an XPath expression that returns something other than a node set
to SimpleXMLElement::xpath() will now emit a warning and return false,
Expand Down
5 changes: 0 additions & 5 deletions ext/pdo_pgsql/pdo_pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ PHP_METHOD(Pdo_Pgsql, setNoticeCallback)
PHP_MINIT_FUNCTION(pdo_pgsql)
{
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_ATTR_DISABLE_PREPARES", PDO_PGSQL_ATTR_DISABLE_PREPARES);
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_IDLE", (zend_long)PGSQL_TRANSACTION_IDLE);
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_ACTIVE", (zend_long)PGSQL_TRANSACTION_ACTIVE);
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_INTRANS", (zend_long)PGSQL_TRANSACTION_INTRANS);
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_INERROR", (zend_long)PGSQL_TRANSACTION_INERROR);
REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_UNKNOWN", (zend_long)PGSQL_TRANSACTION_UNKNOWN);

PdoPgsql_ce = register_class_Pdo_Pgsql(pdo_dbh_ce);
PdoPgsql_ce->create_object = pdo_dbh_new;
Expand Down
15 changes: 0 additions & 15 deletions ext/pdo_pgsql/pdo_pgsql.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ class Pgsql extends \PDO
public const int ATTR_RESULT_MEMORY_SIZE = UNKNOWN;
#endif

/** @cvalue PGSQL_TRANSACTION_IDLE */
public const int TRANSACTION_IDLE = UNKNOWN;

/** @cvalue PGSQL_TRANSACTION_ACTIVE */
public const int TRANSACTION_ACTIVE = UNKNOWN;

/** @cvalue PGSQL_TRANSACTION_INTRANS */
public const int TRANSACTION_INTRANS = UNKNOWN;

/** @cvalue PGSQL_TRANSACTION_INERROR */
public const int TRANSACTION_INERROR = UNKNOWN;

/** @cvalue PGSQL_TRANSACTION_UNKNOWN */
public const int TRANSACTION_UNKNOWN = UNKNOWN;

public function escapeIdentifier(string $input): string {}

public function copyFromArray(string $tableName, array $rows, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {}
Expand Down
32 changes: 1 addition & 31 deletions ext/pdo_pgsql/pdo_pgsql_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions ext/pdo_pgsql/php_pdo_pgsql_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,6 @@ struct pdo_pgsql_lob_self {
Oid oid;
};

enum pdo_pgsql_specific_constants {
PGSQL_TRANSACTION_IDLE = PQTRANS_IDLE,
PGSQL_TRANSACTION_ACTIVE = PQTRANS_ACTIVE,
PGSQL_TRANSACTION_INTRANS = PQTRANS_INTRANS,
PGSQL_TRANSACTION_INERROR = PQTRANS_INERROR,
PGSQL_TRANSACTION_UNKNOWN = PQTRANS_UNKNOWN
};

php_stream *pdo_pgsql_create_lob_stream(zend_object *pdh, int lfd, Oid oid);
extern const php_stream_ops pdo_pgsql_lob_stream_ops;

Expand Down
Loading