mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/pgsql: Enable lo_tell64/lo_truncate64 by removing dead VE_PG_LO64 guards
The guards reference undefined VE_PG_LO64, a misspelling of HAVE_PG_LO64 (removed in GH-14628), making the 64-bit code paths permanently dead. Remove the guards to unconditionally enable the 64-bit variants for PostgreSQL >= 9.3, consistent with pg_lo_seek(). Dropped from GH-21386 as not suitable for backport. close GH-21437
This commit is contained in:
4
NEWS
4
NEWS
@@ -72,6 +72,10 @@ PHP NEWS
|
|||||||
. Clear session-local state disconnect-equivalent processing.
|
. Clear session-local state disconnect-equivalent processing.
|
||||||
(KentarouTakeda)
|
(KentarouTakeda)
|
||||||
|
|
||||||
|
- PGSQL:
|
||||||
|
. Enabled 64 bits support for pg_lo_truncate()/pg_lo_tell()
|
||||||
|
if the server supports it. (KentarouTakeda)
|
||||||
|
|
||||||
- Phar:
|
- Phar:
|
||||||
. Support reference values in Phar::mungServer(). (ndossche)
|
. Support reference values in Phar::mungServer(). (ndossche)
|
||||||
. Invalid values now throw in Phar::mungServer() instead of being silently
|
. Invalid values now throw in Phar::mungServer() instead of being silently
|
||||||
|
|||||||
@@ -3083,15 +3083,11 @@ PHP_FUNCTION(pg_lo_tell)
|
|||||||
pgsql = Z_PGSQL_LOB_P(pgsql_id);
|
pgsql = Z_PGSQL_LOB_P(pgsql_id);
|
||||||
CHECK_PGSQL_LOB(pgsql);
|
CHECK_PGSQL_LOB(pgsql);
|
||||||
|
|
||||||
#ifdef VE_PG_LO64
|
|
||||||
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
|
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
|
||||||
offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd);
|
offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd);
|
||||||
} else {
|
} else {
|
||||||
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
|
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
|
|
||||||
#endif
|
|
||||||
RETURN_LONG(offset);
|
RETURN_LONG(offset);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
@@ -3112,15 +3108,11 @@ PHP_FUNCTION(pg_lo_truncate)
|
|||||||
pgsql = Z_PGSQL_LOB_P(pgsql_id);
|
pgsql = Z_PGSQL_LOB_P(pgsql_id);
|
||||||
CHECK_PGSQL_LOB(pgsql);
|
CHECK_PGSQL_LOB(pgsql);
|
||||||
|
|
||||||
#ifdef VE_PG_LO64
|
|
||||||
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
|
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
|
||||||
result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size);
|
result = lo_truncate64((PGconn *)pgsql->conn, pgsql->lofd, size);
|
||||||
} else {
|
} else {
|
||||||
result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
|
result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
result = lo_truncate((PGconn *)pgsql->conn, pgsql->lofd, size);
|
|
||||||
#endif
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
RETURN_TRUE;
|
RETURN_TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user