Skip to content

Commit c766785

Browse files
ext/pgsql: Fix preprocessor guard typos that silently disabled features
1. Remove dead `VE_PG_LO64` guards from `pg_lo_tell()`/`pg_lo_truncate()`. GH-14628 removed `HAVE_PG_LO64` from the build system and the corresponding guard in `pg_lo_seek()`, but missed these two functions. The leftover guards reference undefined `VE_PG_LO64` (a misspelling of the removed `HAVE_PG_LO64`), making the `lo_tell64()`/`lo_truncate64()` code paths permanently dead. 2. Fix `PQTRACE_SUPPRESS_TIMESTAMPS` guard misspelling in pgsql.stub.php. The guard has been misspelled as `PQTRACE_SUPPPRESS_TIMESTAMPS` (three P's) since 7ec8ae1, preventing the `PGSQL_TRACE_SUPPRESS_TIMESTAMPS` constant from being registered.
1 parent 0acde11 commit c766785

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

ext/pgsql/pgsql.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,15 +3040,11 @@ PHP_FUNCTION(pg_lo_tell)
30403040
pgsql = Z_PGSQL_LOB_P(pgsql_id);
30413041
CHECK_PGSQL_LOB(pgsql);
30423042

3043-
#ifdef VE_PG_LO64
30443043
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
30453044
offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd);
30463045
} else {
30473046
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
30483047
}
3049-
#else
3050-
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
3051-
#endif
30523048
RETURN_LONG(offset);
30533049
}
30543050
/* }}} */
@@ -3069,15 +3065,11 @@ PHP_FUNCTION(pg_lo_truncate)
30693065
pgsql = Z_PGSQL_LOB_P(pgsql_id);
30703066
CHECK_PGSQL_LOB(pgsql);
30713067

3072-
#ifdef VE_PG_LO64
30733068
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
30743069
result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size);
30753070
} else {
30763071
result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
30773072
}
3078-
#else
3079-
result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
3080-
#endif
30813073
if (!result) {
30823074
RETURN_TRUE;
30833075
} else {

ext/pgsql/pgsql.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@
432432
* @cvalue PGSQL_DML_STRING
433433
*/
434434
const PGSQL_DML_STRING = UNKNOWN;
435-
#ifdef PQTRACE_SUPPPRESS_TIMESTAMPS
435+
#ifdef PQTRACE_SUPPRESS_TIMESTAMPS
436436
/**
437437
* @var int
438438
* @cvalue PQTRACE_SUPPRESS_TIMESTAMPS

ext/pgsql/pgsql_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)